<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE NondecreasingIndentation #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE TypeSynonymInstances #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-comment">-- | This is the driver for the 'ghc --backpack' mode, which</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- is a reimplementation of the &quot;package manager&quot; bits of</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Backpack directly in GHC.  The basic method of operation</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- is to compile packages and then directly insert them into</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- GHC's in memory database.</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- The compilation products of this mode aren't really suitable</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- for Cabal, because GHC makes up component IDs for the things</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- it builds and doesn't serialize out the database contents.</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- But it's still handy for constructing tests.</span><span>
</span><span id="line-16"></span><span>
</span><span id="line-17"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Driver.Backpack</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.html#doBackpack"><span class="hs-identifier">doBackpack</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-comment">-- In a separate module because it hooks into the parser.</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html"><span class="hs-identifier">GHC.Driver.Backpack.Syntax</span></a></span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Annotation.html"><span class="hs-identifier">GHC.Parser.Annotation</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.html"><span class="hs-identifier">GHC</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#Failed"><span class="hs-identifier">Failed</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Succeeded"><span class="hs-identifier">Succeeded</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.html"><span class="hs-identifier">GHC.Parser</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Lexer.html"><span class="hs-identifier">GHC.Parser.Lexer</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html"><span class="hs-identifier">GHC.Driver.Monad</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Module.html"><span class="hs-identifier">GHC.Tc.Module</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.StringBuffer.html"><span class="hs-identifier">GHC.Data.StringBuffer</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Main.html"><span class="hs-identifier">GHC.Driver.Main</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html"><span class="hs-identifier">GHC.Types.Unique.DFM</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Parser.Header.html"><span class="hs-identifier">GHC.Parser.Header</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Recomp.html"><span class="hs-identifier">GHC.Iface.Recomp</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Make.html"><span class="hs-identifier">GHC.Driver.Make</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DSet.html"><span class="hs-identifier">GHC.Types.Unique.DSet</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#SuccessFlag"><span class="hs-identifier">SuccessFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html"><span class="hs-identifier">GHC.Driver.Finder</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.Exit.html#"><span class="hs-identifier">System.Exit</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Version.html#"><span class="hs-identifier">Data.Version</span></a></span><span>
</span><span id="line-62"></span><span>
</span><span id="line-63"></span><span class="hs-comment">-- for the unification</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier">Map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-comment">-- | Entry point to compile a Backpack file.</span><span>
</span><span id="line-69"></span><span class="annot"><a href="GHC.Driver.Backpack.html#doBackpack"><span class="hs-identifier hs-type">doBackpack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#Ghc"><span class="hs-identifier hs-type">Ghc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span id="doBackpack"><span class="annot"><span class="annottext">doBackpack :: [FilePath] -&gt; Ghc ()
</span><a href="GHC.Driver.Backpack.html#doBackpack"><span class="hs-identifier hs-var hs-var">doBackpack</span></a></span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621681211807"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211807"><span class="hs-identifier hs-var">src_filename</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-comment">-- Apply options from file to dflags</span><span>
</span><span id="line-72"></span><span>    </span><span id="local-6989586621681211806"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211806"><span class="hs-identifier hs-var">dflags0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ghc DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-73"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211804"><span class="annot"><span class="annottext">dflags1 :: DynFlags
</span><a href="#local-6989586621681211804"><span class="hs-identifier hs-var hs-var">dflags1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211806"><span class="hs-identifier hs-var">dflags0</span></a></span><span>
</span><span id="line-74"></span><span>    </span><span id="local-6989586621681211803"><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681211803"><span class="hs-identifier hs-var">src_opts</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [Located FilePath] -&gt; Ghc [Located FilePath]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [Located FilePath] -&gt; Ghc [Located FilePath])
-&gt; IO [Located FilePath] -&gt; Ghc [Located FilePath]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; IO [Located FilePath]
</span><a href="GHC.Parser.Header.html#getOptionsFromFile"><span class="hs-identifier hs-var">getOptionsFromFile</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211804"><span class="hs-identifier hs-var">dflags1</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211807"><span class="hs-identifier hs-var">src_filename</span></a></span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681211800"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211799"><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681211799"><span class="hs-identifier hs-var">unhandled_flags</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211798"><span class="annot"><span class="annottext">[Warn]
</span><a href="#local-6989586621681211798"><span class="hs-identifier hs-var">warns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (DynFlags, [Located FilePath], [Warn])
-&gt; Ghc (DynFlags, [Located FilePath], [Warn])
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (DynFlags, [Located FilePath], [Warn])
 -&gt; Ghc (DynFlags, [Located FilePath], [Warn]))
-&gt; IO (DynFlags, [Located FilePath], [Warn])
-&gt; Ghc (DynFlags, [Located FilePath], [Warn])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [Located FilePath] -&gt; IO (DynFlags, [Located FilePath], [Warn])
forall (m :: * -&gt; *).
MonadIO m =&gt;
DynFlags
-&gt; [Located FilePath] -&gt; m (DynFlags, [Located FilePath], [Warn])
</span><a href="GHC.Driver.Session.html#parseDynamicFilePragma"><span class="hs-identifier hs-var">parseDynamicFilePragma</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211804"><span class="hs-identifier hs-var">dflags1</span></a></span><span> </span><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681211803"><span class="hs-identifier hs-var">src_opts</span></a></span><span>
</span><span id="line-76"></span><span>    </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; Ghc ()
forall (m :: * -&gt; *). GhcMonad m =&gt; (HscEnv -&gt; HscEnv) -&gt; m ()
</span><a href="GHC.Driver.Monad.html#modifySession"><span class="hs-identifier hs-var">modifySession</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681211795"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211795"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211795"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>    </span><span class="hs-comment">-- Cribbed from: preprocessFile / GHC.Driver.Pipeline</span><span>
</span><span id="line-78"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; Ghc ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; Ghc ()) -&gt; IO () -&gt; Ghc ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [Located FilePath] -&gt; IO ()
forall (m :: * -&gt; *).
MonadIO m =&gt;
DynFlags -&gt; [Located FilePath] -&gt; m ()
</span><a href="GHC.Parser.Header.html#checkProcessArgsResult"><span class="hs-identifier hs-var">checkProcessArgsResult</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[Located FilePath]
</span><a href="#local-6989586621681211799"><span class="hs-identifier hs-var">unhandled_flags</span></a></span><span>
</span><span id="line-79"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; Ghc ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; Ghc ()) -&gt; IO () -&gt; Ghc ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [Warn] -&gt; IO ()
</span><a href="GHC.Driver.Types.html#handleFlagWarnings"><span class="hs-identifier hs-var">handleFlagWarnings</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[Warn]
</span><a href="#local-6989586621681211798"><span class="hs-identifier hs-var">warns</span></a></span><span>
</span><span id="line-80"></span><span>    </span><span class="hs-comment">-- TODO: Preprocessing not implemented</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span>    </span><span id="local-6989586621681211791"><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621681211791"><span class="hs-identifier hs-var">buf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO StringBuffer -&gt; Ghc StringBuffer
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO StringBuffer -&gt; Ghc StringBuffer)
-&gt; IO StringBuffer -&gt; Ghc StringBuffer
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO StringBuffer
</span><a href="GHC.Data.StringBuffer.html#hGetStringBuffer"><span class="hs-identifier hs-var">hGetStringBuffer</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211807"><span class="hs-identifier hs-var">src_filename</span></a></span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211789"><span class="annot"><span class="annottext">loc :: RealSrcLoc
</span><a href="#local-6989586621681211789"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; RealSrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkRealSrcLoc"><span class="hs-identifier hs-var">mkRealSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211807"><span class="hs-identifier hs-var">src_filename</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-comment">-- TODO: not great</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">P [LHsUnit PackageName]
-&gt; PState -&gt; ParseResult [LHsUnit PackageName]
forall a. P a -&gt; PState -&gt; ParseResult a
</span><a href="GHC.Parser.Lexer.html#unP"><span class="hs-identifier hs-var hs-var">unP</span></a></span><span> </span><span class="annot"><span class="annottext">P [LHsUnit PackageName]
</span><a href="GHC.Parser.html#parseBackpack"><span class="hs-identifier hs-var">parseBackpack</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; StringBuffer -&gt; RealSrcLoc -&gt; PState
</span><a href="GHC.Parser.Lexer.html#mkPState"><span class="hs-identifier hs-var">mkPState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">StringBuffer
</span><a href="#local-6989586621681211791"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcLoc
</span><a href="#local-6989586621681211789"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><a href="GHC.Parser.Lexer.html#PFailed"><span class="hs-identifier hs-type">PFailed</span></a></span><span> </span><span id="local-6989586621681211782"><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681211782"><span class="hs-identifier hs-var">pst</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorMessages -&gt; Ghc ()
forall (io :: * -&gt; *) a. MonadIO io =&gt; ErrorMessages -&gt; io a
</span><a href="GHC.Driver.Types.html#throwErrors"><span class="hs-identifier hs-var">throwErrors</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PState -&gt; DynFlags -&gt; ErrorMessages
</span><a href="GHC.Parser.Lexer.html#getErrorMessages"><span class="hs-identifier hs-var">getErrorMessages</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><a href="#local-6989586621681211782"><span class="hs-identifier hs-var">pst</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><a href="GHC.Parser.Lexer.html#POk"><span class="hs-identifier hs-type">POk</span></a></span><span> </span><span class="annot"><span class="annottext">PState
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211778"><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211778"><span class="hs-identifier hs-var">pkgname_bkp</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-87"></span><span>            </span><span class="hs-comment">-- OK, so we have an LHsUnit PackageName, but we want an</span><span>
</span><span id="line-88"></span><span>            </span><span class="hs-comment">-- LHsUnit HsComponentId.  So let's rename it.</span><span>
</span><span id="line-89"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211777"><span class="annot"><span class="annottext">pkgstate :: UnitState
</span><a href="#local-6989586621681211777"><span class="hs-identifier hs-var hs-var">pkgstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211800"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-90"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211775"><span class="annot"><span class="annottext">bkp :: [LHsUnit HsComponentId]
</span><a href="#local-6989586621681211775"><span class="hs-identifier hs-var hs-var">bkp</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitState
-&gt; PackageNameMap HsComponentId
-&gt; [LHsUnit PackageName]
-&gt; [LHsUnit HsComponentId]
</span><a href="GHC.Driver.Backpack.html#renameHsUnits"><span class="hs-identifier hs-var">renameHsUnits</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211777"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; [LHsUnit PackageName] -&gt; PackageNameMap HsComponentId
</span><a href="GHC.Driver.Backpack.html#bkpPackageNameMap"><span class="hs-identifier hs-var">bkpPackageNameMap</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211777"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211778"><span class="hs-identifier hs-var">pkgname_bkp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211778"><span class="hs-identifier hs-var">pkgname_bkp</span></a></span><span>
</span><span id="line-91"></span><span>            </span><span class="annot"><span class="annottext">FilePath -&gt; [LHsUnit HsComponentId] -&gt; BkpM () -&gt; Ghc ()
forall a. FilePath -&gt; [LHsUnit HsComponentId] -&gt; BkpM a -&gt; Ghc a
</span><a href="GHC.Driver.Backpack.html#initBkpM"><span class="hs-identifier hs-var">initBkpM</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211807"><span class="hs-identifier hs-var">src_filename</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsUnit HsComponentId]
</span><a href="#local-6989586621681211775"><span class="hs-identifier hs-var">bkp</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpM () -&gt; Ghc ()) -&gt; BkpM () -&gt; Ghc ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-92"></span><span>                </span><span class="annot"><span class="annottext">[(Int, LHsUnit HsComponentId)]
-&gt; ((Int, LHsUnit HsComponentId) -&gt; BkpM ()) -&gt; BkpM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; [LHsUnit HsComponentId] -&gt; [(Int, LHsUnit HsComponentId)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[LHsUnit HsComponentId]
</span><a href="#local-6989586621681211775"><span class="hs-identifier hs-var">bkp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(((Int, LHsUnit HsComponentId) -&gt; BkpM ()) -&gt; BkpM ())
-&gt; ((Int, LHsUnit HsComponentId) -&gt; BkpM ()) -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211770"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211770"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211769"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211769"><span class="hs-identifier hs-var">lunit</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-93"></span><span>                    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211768"><span class="annot"><span class="annottext">comp_name :: HsComponentId
</span><a href="#local-6989586621681211768"><span class="hs-identifier hs-var hs-var">comp_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan HsComponentId -&gt; HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId -&gt; GenLocated SrcSpan HsComponentId
forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var hs-var">hsunitName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211769"><span class="hs-identifier hs-var">lunit</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span>                    </span><span class="annot"><span class="annottext">(Int, Int) -&gt; HsComponentId -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgTopPackage"><span class="hs-identifier hs-var">msgTopPackage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211770"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[LHsUnit HsComponentId] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsUnit HsComponentId]
</span><a href="#local-6989586621681211775"><span class="hs-identifier hs-var">bkp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsComponentId
</span><a href="#local-6989586621681211768"><span class="hs-identifier hs-var">comp_name</span></a></span><span>
</span><span id="line-95"></span><span>                    </span><span class="annot"><span class="annottext">BkpM () -&gt; BkpM ()
forall a. BkpM a -&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#innerBkpM"><span class="hs-identifier hs-var">innerBkpM</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpM () -&gt; BkpM ()) -&gt; BkpM () -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-96"></span><span>                        </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211762"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211762"><span class="hs-identifier hs-var">cid</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211761"><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211761"><span class="hs-identifier hs-var">insts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; (IndefUnitId, [(ModuleName, Module)])
</span><a href="GHC.Driver.Backpack.html#computeUnitId"><span class="hs-identifier hs-var">computeUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211769"><span class="hs-identifier hs-var">lunit</span></a></span><span>
</span><span id="line-97"></span><span>                        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211761"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-98"></span><span>                            </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211762"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; IndefUnitId -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Maybe UnitPprInfo -&gt; IndefUnitId
forall unit. unit -&gt; Maybe UnitPprInfo -&gt; Indefinite unit
</span><a href="GHC.Unit.Types.html#Indefinite"><span class="hs-identifier hs-var">Indefinite</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; UnitId
</span><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-var">UnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;main&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe UnitPprInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-99"></span><span>                                    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileExe"><span class="hs-identifier hs-var">compileExe</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211769"><span class="hs-identifier hs-var">lunit</span></a></span><span>
</span><span id="line-100"></span><span>                                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileUnit"><span class="hs-identifier hs-var">compileUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211762"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-101"></span><span>                            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#typecheckUnit"><span class="hs-identifier hs-var">typecheckUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211762"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211761"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-102"></span><span class="annot"><a href="GHC.Driver.Backpack.html#doBackpack"><span class="hs-identifier hs-var">doBackpack</span></a></span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-103"></span><span>    </span><span class="annot"><span class="annottext">GhcException -&gt; Ghc ()
forall a. GhcException -&gt; a
</span><a href="GHC.Utils.Panic.html#throwGhcException"><span class="hs-identifier hs-var">throwGhcException</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; GhcException
</span><a href="GHC.Utils.Panic.html#CmdLineError"><span class="hs-identifier hs-var">CmdLineError</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;--backpack can only process a single file&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="annot"><a href="GHC.Driver.Backpack.html#computeUnitId"><span class="hs-identifier hs-type">computeUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span id="computeUnitId"><span class="annot"><span class="annottext">computeUnitId :: LHsUnit HsComponentId -&gt; (IndefUnitId, [(ModuleName, Module)])
</span><a href="GHC.Driver.Backpack.html#computeUnitId"><span class="hs-identifier hs-var hs-var">computeUnitId</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211749"><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211749"><span class="hs-keyword hs-var">unit</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211748"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211747"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Module
forall u. ModuleName -&gt; GenModule (GenUnit u)
</span><a href="GHC.Unit.Module.html#mkHoleModule"><span class="hs-identifier hs-var">mkHoleModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211747"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681211747"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211747"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681211745"><span class="hs-identifier hs-var">reqs</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-107"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621681211748"><span class="annot"><span class="annottext">cid :: IndefUnitId
</span><a href="#local-6989586621681211748"><span class="hs-identifier hs-var hs-var">cid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsComponentId -&gt; IndefUnitId
</span><a href="GHC.Driver.Backpack.Syntax.html#hsComponentId"><span class="hs-identifier hs-var hs-var">hsComponentId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan HsComponentId -&gt; HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId -&gt; GenLocated SrcSpan HsComponentId
forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var hs-var">hsunitName</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211749"><span class="hs-keyword hs-var">unit</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621681211745"><span class="annot"><span class="annottext">reqs :: [ModuleName]
</span><a href="#local-6989586621681211745"><span class="hs-identifier hs-var hs-var">reqs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDSet ModuleName -&gt; [ModuleName]
forall a. UniqDSet a -&gt; [a]
</span><a href="GHC.Types.Unique.DSet.html#uniqDSetToList"><span class="hs-identifier hs-var">uniqDSetToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[UniqDSet ModuleName] -&gt; UniqDSet ModuleName
forall a. [UniqDSet a] -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#unionManyUniqDSets"><span class="hs-identifier hs-var">unionManyUniqDSets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsUnitDecl HsComponentId)
 -&gt; UniqDSet ModuleName)
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
-&gt; [UniqDSet ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnitDecl HsComponentId -&gt; UniqDSet ModuleName
</span><a href="#local-6989586621681211741"><span class="hs-identifier hs-var">get_reqs</span></a></span><span> </span><span class="annot"><span class="annottext">(HsUnitDecl HsComponentId -&gt; UniqDSet ModuleName)
-&gt; (GenLocated SrcSpan (HsUnitDecl HsComponentId)
    -&gt; HsUnitDecl HsComponentId)
-&gt; GenLocated SrcSpan (HsUnitDecl HsComponentId)
-&gt; UniqDSet ModuleName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitDecl HsComponentId)
-&gt; HsUnitDecl HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
forall n. HsUnit n -&gt; [LHsUnitDecl n]
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitBody"><span class="hs-identifier hs-var hs-var">hsunitBody</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211749"><span class="hs-keyword hs-var">unit</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621681211741"><span class="annot"><span class="annottext">get_reqs :: HsUnitDecl HsComponentId -&gt; UniqDSet ModuleName
</span><a href="#local-6989586621681211741"><span class="hs-identifier hs-var hs-var">get_reqs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-type">DeclD</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211734"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211734"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; UniqDSet ModuleName
forall a. Uniquable a =&gt; a -&gt; UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#unitUniqDSet"><span class="hs-identifier hs-var">unitUniqDSet</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211734"><span class="hs-identifier hs-var">modname</span></a></span><span>
</span><span id="line-111"></span><span>    </span><span class="annot"><a href="#local-6989586621681211741"><span class="hs-identifier hs-var">get_reqs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-type">DeclD</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsSrcFile"><span class="hs-identifier hs-var">HsSrcFile</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDSet ModuleName
forall a. UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#emptyUniqDSet"><span class="hs-identifier hs-var">emptyUniqDSet</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span class="annot"><a href="#local-6989586621681211741"><span class="hs-identifier hs-var">get_reqs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-type">DeclD</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsBootFile"><span class="hs-identifier hs-var">HsBootFile</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDSet ModuleName
forall a. UniqDSet a
</span><a href="GHC.Types.Unique.DSet.html#emptyUniqDSet"><span class="hs-identifier hs-var">emptyUniqDSet</span></a></span><span>
</span><span id="line-113"></span><span>    </span><span class="annot"><a href="#local-6989586621681211741"><span class="hs-identifier hs-var">get_reqs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#IncludeD"><span class="hs-identifier hs-type">IncludeD</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#IncludeDecl"><span class="hs-identifier hs-type">IncludeDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211727"><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211727"><span class="hs-identifier hs-var">hsuid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe [LRenaming]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-114"></span><span>        </span><span class="annot"><span class="annottext">Unit -&gt; UniqDSet ModuleName
forall u. GenUnit u -&gt; UniqDSet ModuleName
</span><a href="GHC.Unit.Types.html#unitFreeModuleHoles"><span class="hs-identifier hs-var">unitFreeModuleHoles</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnitId HsComponentId -&gt; Unit
</span><a href="GHC.Driver.Backpack.html#convertHsComponentId"><span class="hs-identifier hs-var">convertHsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211727"><span class="hs-identifier hs-var">hsuid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-comment">-- | Tiny enum for all types of Backpack operations we may do.</span><span>
</span><span id="line-117"></span><span class="hs-keyword">data</span><span> </span><span id="SessionType"><span class="annot"><a href="GHC.Driver.Backpack.html#SessionType"><span class="hs-identifier hs-var">SessionType</span></a></span></span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-comment">-- | A compilation operation which will result in a</span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-comment">-- runnable executable being produced.</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="ExeSession"><span class="annot"><a href="GHC.Driver.Backpack.html#ExeSession"><span class="hs-identifier hs-var">ExeSession</span></a></span></span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-comment">-- | A type-checking operation which produces only</span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-comment">-- interface files, no object files.</span><span>
</span><span id="line-123"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="TcSession"><span class="annot"><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span></span><span>
</span><span id="line-124"></span><span>    </span><span class="hs-comment">-- | A compilation operation which produces both</span><span>
</span><span id="line-125"></span><span>    </span><span class="hs-comment">-- interface files and object files.</span><span>
</span><span id="line-126"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="CompSession"><span class="annot"><a href="GHC.Driver.Backpack.html#CompSession"><span class="hs-identifier hs-var">CompSession</span></a></span></span><span>
</span><span id="line-127"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211718"><span id="local-6989586621681211720"><span class="annot"><span class="annottext">SessionType -&gt; SessionType -&gt; Bool
(SessionType -&gt; SessionType -&gt; Bool)
-&gt; (SessionType -&gt; SessionType -&gt; Bool) -&gt; Eq SessionType
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: SessionType -&gt; SessionType -&gt; Bool
$c/= :: SessionType -&gt; SessionType -&gt; Bool
== :: SessionType -&gt; SessionType -&gt; Bool
$c== :: SessionType -&gt; SessionType -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span>
</span><span id="line-129"></span><span class="hs-comment">-- | Create a temporary Session to do some sort of type checking or</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- compilation.</span><span>
</span><span id="line-131"></span><span id="local-6989586621681212228"><span class="annot"><a href="GHC.Driver.Backpack.html#withBkpSession"><span class="hs-identifier hs-type">withBkpSession</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span>
</span><span id="line-132"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-133"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#ModRenaming"><span class="hs-identifier hs-type">ModRenaming</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-134"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#SessionType"><span class="hs-identifier hs-type">SessionType</span></a></span><span>   </span><span class="hs-comment">-- what kind of session are we doing</span><span>
</span><span id="line-135"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212228"><span class="hs-identifier hs-type">a</span></a></span><span>        </span><span class="hs-comment">-- actual action to run</span><span>
</span><span id="line-136"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212228"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-137"></span><span id="withBkpSession"><span class="annot"><span class="annottext">withBkpSession :: forall a.
IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; [(Unit, ModRenaming)]
-&gt; SessionType
-&gt; BkpM a
-&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#withBkpSession"><span class="hs-identifier hs-var hs-var">withBkpSession</span></a></span></span><span> </span><span id="local-6989586621681211700"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621681211699"><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span id="local-6989586621681211698"><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211698"><span class="hs-identifier hs-var">deps</span></a></span></span><span> </span><span id="local-6989586621681211697"><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span></span><span> </span><span id="local-6989586621681211696"><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211696"><span class="hs-identifier hs-var">do_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621681211695"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211695"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211694"><span class="annot"><span class="annottext">cid_fs :: FastString
</span><a href="#local-6989586621681211694"><span class="hs-identifier hs-var hs-var">cid_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitIdFS"><span class="hs-identifier hs-var hs-var">unitIdFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; UnitId
forall unit. Indefinite unit -&gt; unit
</span><a href="GHC.Unit.Types.html#indefUnit"><span class="hs-identifier hs-var hs-var">indefUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span>        </span><span id="local-6989586621681211691"><span class="annot"><span class="annottext">is_primary :: Bool
</span><a href="#local-6989586621681211691"><span class="hs-identifier hs-var hs-var">is_primary</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-141"></span><span>        </span><span id="local-6989586621681211690"><span class="annot"><span class="annottext">uid_str :: FilePath
</span><a href="#local-6989586621681211690"><span class="hs-identifier hs-var hs-var">uid_str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; FastString
</span><a href="GHC.Unit.Types.html#mkInstantiatedUnitHash"><span class="hs-identifier hs-var">mkInstantiatedUnitHash</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>        </span><span id="local-6989586621681211687"><span class="annot"><span class="annottext">cid_str :: FilePath
</span><a href="#local-6989586621681211687"><span class="hs-identifier hs-var hs-var">cid_str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211694"><span class="hs-identifier hs-var">cid_fs</span></a></span><span>
</span><span id="line-143"></span><span>        </span><span class="hs-comment">-- There are multiple units in a single Backpack file, so we</span><span>
</span><span id="line-144"></span><span>        </span><span class="hs-comment">-- need to separate out the results in those cases.  Right now,</span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-comment">-- we follow this hierarchy:</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-comment">--      $outputdir/$compid          --&gt; typecheck results</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-comment">--      $outputdir/$compid/$unitid  --&gt; compile results</span><span>
</span><span id="line-148"></span><span>        </span><span id="local-6989586621681211686"><span class="annot"><span class="annottext">key_base :: (DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211686"><span class="hs-identifier hs-var hs-var">key_base</span></a></span></span><span> </span><span id="local-6989586621681211685"><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="#local-6989586621681211685"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211684"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211684"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="#local-6989586621681211685"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211695"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211684"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-149"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;.&quot;</span></span><span>
</span><span id="line-150"></span><span>        </span><span id="local-6989586621681211683"><span class="annot"><span class="annottext">sub_comp :: FilePath -&gt; FilePath
</span><a href="#local-6989586621681211683"><span class="hs-identifier hs-var hs-var">sub_comp</span></a></span></span><span> </span><span id="local-6989586621681211682"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211682"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211691"><span class="hs-identifier hs-var">is_primary</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211682"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-151"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211682"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211687"><span class="hs-identifier hs-var">cid_str</span></a></span><span>
</span><span id="line-152"></span><span>        </span><span id="local-6989586621681211679"><span class="annot"><span class="annottext">outdir :: (DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211679"><span class="hs-identifier hs-var hs-var">outdir</span></a></span></span><span> </span><span id="local-6989586621681211678"><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="#local-6989586621681211678"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#CompSession"><span class="hs-identifier hs-var">CompSession</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span><span>
</span><span id="line-153"></span><span>                 </span><span class="hs-comment">-- Special case when package is definite</span><span>
</span><span id="line-154"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621681211683"><span class="hs-identifier hs-var">sub_comp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211686"><span class="hs-identifier hs-var">key_base</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="#local-6989586621681211678"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211690"><span class="hs-identifier hs-var">uid_str</span></a></span><span>
</span><span id="line-155"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621681211683"><span class="hs-identifier hs-var">sub_comp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211686"><span class="hs-identifier hs-var">key_base</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="#local-6989586621681211678"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>    </span><span class="annot"><span class="annottext">(HscEnv -&gt; HscEnv) -&gt; BkpM a -&gt; BkpM a
forall (m :: * -&gt; *) a.
GhcMonad m =&gt;
(HscEnv -&gt; HscEnv) -&gt; m a -&gt; m a
</span><a href="GHC.Driver.Monad.html#withTempSession"><span class="hs-identifier hs-var">withTempSession</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; DynFlags) -&gt; HscEnv -&gt; HscEnv
</span><a href="GHC.Driver.Backpack.html#overHscDynFlags"><span class="hs-identifier hs-var">overHscDynFlags</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681211674"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-157"></span><span>      </span><span class="hs-comment">-- If we're type-checking an indefinite package, we want to</span><span>
</span><span id="line-158"></span><span>      </span><span class="hs-comment">-- turn on interface writing.  However, if the user also</span><span>
</span><span id="line-159"></span><span>      </span><span class="hs-comment">-- explicitly passed in `-fno-code`, we DON'T want to write</span><span>
</span><span id="line-160"></span><span>      </span><span class="hs-comment">-- interfaces unless the user also asked for `-fwrite-interface`.</span><span>
</span><span id="line-161"></span><span>      </span><span class="hs-comment">-- See Note [-fno-code mode]</span><span>
</span><span id="line-162"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-163"></span><span>        </span><span class="hs-comment">-- Make sure to write interfaces when we are type-checking</span><span>
</span><span id="line-164"></span><span>        </span><span class="hs-comment">-- indefinite packages.</span><span>
</span><span id="line-165"></span><span>        </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscTarget -&gt; HscTarget -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscNothing"><span class="hs-identifier hs-var">HscNothing</span></a></span><span>
</span><span id="line-166"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; GeneralFlag -&gt; DynFlags)
-&gt; GeneralFlag -&gt; DynFlags -&gt; DynFlags
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GeneralFlag -&gt; DynFlags
</span><a href="GHC.Driver.Session.html#gopt_set"><span class="hs-identifier hs-var">gopt_set</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_WriteInterface"><span class="hs-identifier hs-var">Opt_WriteInterface</span></a></span><span>
</span><span id="line-167"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-168"></span><span>        </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#CompSession"><span class="hs-identifier hs-var">CompSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-169"></span><span>        </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#ExeSession"><span class="hs-identifier hs-var">ExeSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; DynFlags) -&gt; DynFlags -&gt; DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-170"></span><span>      </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-171"></span><span>        </span><span class="annot"><span class="annottext">hscTarget :: HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var">hscTarget</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-172"></span><span>                        </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscTarget
</span><a href="GHC.Driver.Session.html#HscNothing"><span class="hs-identifier hs-var">HscNothing</span></a></span><span>
</span><span id="line-173"></span><span>                        </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-174"></span><span>        </span><span class="annot"><span class="annottext">homeUnitInstantiations :: [(ModuleName, Module)]
</span><a href="GHC.Driver.Session.html#homeUnitInstantiations"><span class="hs-identifier hs-var">homeUnitInstantiations</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-175"></span><span>                                 </span><span class="hs-comment">-- if we don't have any instantiation, don't</span><span>
</span><span id="line-176"></span><span>                                 </span><span class="hs-comment">-- fill `homeUnitInstanceOfId` as it makes no</span><span>
</span><span id="line-177"></span><span>                                 </span><span class="hs-comment">-- sense (we're not instantiating anything)</span><span>
</span><span id="line-178"></span><span>        </span><span class="annot"><span class="annottext">homeUnitInstanceOfId :: Maybe IndefUnitId
</span><a href="GHC.Driver.Session.html#homeUnitInstanceOfId"><span class="hs-identifier hs-var">homeUnitInstanceOfId</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe IndefUnitId
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; Maybe IndefUnitId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-179"></span><span>        </span><span class="annot"><span class="annottext">homeUnitId :: UnitId
</span><a href="GHC.Driver.Session.html#homeUnitId"><span class="hs-identifier hs-var">homeUnitId</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-180"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-181"></span><span>                </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; Maybe FastString -&gt; UnitId
</span><a href="GHC.Driver.Backpack.html#newUnitId"><span class="hs-identifier hs-var">newUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-182"></span><span>                </span><span class="hs-comment">-- No hash passed if no instances</span><span>
</span><span id="line-183"></span><span>                </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; Maybe FastString -&gt; UnitId
</span><a href="GHC.Driver.Backpack.html#newUnitId"><span class="hs-identifier hs-var">newUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-184"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; Maybe FastString -&gt; UnitId
</span><a href="GHC.Driver.Backpack.html#newUnitId"><span class="hs-identifier hs-var">newUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Maybe FastString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; FastString
</span><a href="GHC.Unit.Types.html#mkInstantiatedUnitHash"><span class="hs-identifier hs-var">mkInstantiatedUnitHash</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211700"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-185"></span><span>        </span><span class="hs-comment">-- Setup all of the output directories according to our hierarchy</span><span>
</span><span id="line-186"></span><span>        </span><span class="annot"><span class="annottext">objectDir :: Maybe FilePath
</span><a href="GHC.Driver.Session.html#objectDir"><span class="hs-identifier hs-var">objectDir</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211679"><span class="hs-identifier hs-var">outdir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#objectDir"><span class="hs-identifier hs-var hs-var">objectDir</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-187"></span><span>        </span><span class="annot"><span class="annottext">hiDir :: Maybe FilePath
</span><a href="GHC.Driver.Session.html#hiDir"><span class="hs-identifier hs-var">hiDir</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211679"><span class="hs-identifier hs-var">outdir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#hiDir"><span class="hs-identifier hs-var hs-var">hiDir</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-188"></span><span>        </span><span class="annot"><span class="annottext">stubDir :: Maybe FilePath
</span><a href="GHC.Driver.Session.html#stubDir"><span class="hs-identifier hs-var">stubDir</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(DynFlags -&gt; Maybe FilePath) -&gt; FilePath
</span><a href="#local-6989586621681211679"><span class="hs-identifier hs-var">outdir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#stubDir"><span class="hs-identifier hs-var hs-var">stubDir</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-189"></span><span>        </span><span class="hs-comment">-- Unset output-file for non exe builds</span><span>
</span><span id="line-190"></span><span>        </span><span class="annot"><span class="annottext">outputFile :: Maybe FilePath
</span><a href="GHC.Driver.Session.html#outputFile"><span class="hs-identifier hs-var">outputFile</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211697"><span class="hs-identifier hs-var">session_type</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType -&gt; SessionType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#ExeSession"><span class="hs-identifier hs-var">ExeSession</span></a></span><span>
</span><span id="line-191"></span><span>                        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#outputFile"><span class="hs-identifier hs-var hs-var">outputFile</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-192"></span><span>                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe FilePath
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-comment">-- Clear the import path so we don't accidentally grab anything</span><span>
</span><span id="line-194"></span><span>        </span><span class="annot"><span class="annottext">importPaths :: [FilePath]
</span><a href="GHC.Driver.Session.html#importPaths"><span class="hs-identifier hs-var">importPaths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-195"></span><span>        </span><span class="hs-comment">-- Synthesized the flags</span><span>
</span><span id="line-196"></span><span>        </span><span class="annot"><span class="annottext">packageFlags :: [PackageFlag]
</span><a href="GHC.Driver.Session.html#packageFlags"><span class="hs-identifier hs-var">packageFlags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [PackageFlag]
</span><a href="GHC.Driver.Session.html#packageFlags"><span class="hs-identifier hs-var hs-var">packageFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[PackageFlag] -&gt; [PackageFlag] -&gt; [PackageFlag]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">((Unit, ModRenaming) -&gt; PackageFlag)
-&gt; [(Unit, ModRenaming)] -&gt; [PackageFlag]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211656"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211656"><span class="hs-identifier hs-var">uid0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211655"><span class="annot"><span class="annottext">ModRenaming
</span><a href="#local-6989586621681211655"><span class="hs-identifier hs-var">rn</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-197"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211654"><span class="annot"><span class="annottext">state :: UnitState
</span><a href="#local-6989586621681211654"><span class="hs-identifier hs-var hs-var">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-198"></span><span>              </span><span id="local-6989586621681211652"><span class="annot"><span class="annottext">uid :: Unit
</span><a href="#local-6989586621681211652"><span class="hs-identifier hs-var hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#unwireUnit"><span class="hs-identifier hs-var">unwireUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211654"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#improveUnit"><span class="hs-identifier hs-var">improveUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211654"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="annot"><span class="annottext">(Unit -&gt; Unit) -&gt; Unit -&gt; Unit
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; ShHoleSubst -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#renameHoleUnit"><span class="hs-identifier hs-var">renameHoleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211654"><span class="hs-identifier hs-var">state</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; ShHoleSubst
forall key elt. Uniquable key =&gt; [(key, elt)] -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#listToUFM"><span class="hs-identifier hs-var">listToUFM</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211699"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211656"><span class="hs-identifier hs-var">uid0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; PackageArg -&gt; ModRenaming -&gt; PackageFlag
</span><a href="GHC.Driver.Session.html#ExposePackage"><span class="hs-identifier hs-var">ExposePackage</span></a></span><span>
</span><span id="line-200"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211674"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-201"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;-unit-id&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211652"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModRenaming -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModRenaming
</span><a href="#local-6989586621681211655"><span class="hs-identifier hs-var">rn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; PackageArg
</span><a href="GHC.Driver.Session.html#UnitIdArg"><span class="hs-identifier hs-var">UnitIdArg</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211652"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModRenaming
</span><a href="#local-6989586621681211655"><span class="hs-identifier hs-var">rn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211698"><span class="hs-identifier hs-var">deps</span></a></span><span>
</span><span id="line-203"></span><span>      </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(BkpM a -&gt; BkpM a) -&gt; BkpM a -&gt; BkpM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-204"></span><span>        </span><span id="local-6989586621681211641"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211641"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">getSessionDynFlags</span></a></span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-comment">-- pprTrace &quot;flags&quot; (ppr insts &lt;&gt; ppr deps) $ return ()</span><span>
</span><span id="line-206"></span><span>        </span><span class="annot"><span class="annottext">DynFlags -&gt; BkpM ()
forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var">setSessionDynFlags</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211641"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-comment">-- calls initUnits</span><span>
</span><span id="line-207"></span><span>        </span><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211696"><span class="hs-identifier hs-var">do_this</span></a></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span id="local-6989586621681212206"><span class="annot"><a href="GHC.Driver.Backpack.html#withBkpExeSession"><span class="hs-identifier hs-type">withBkpExeSession</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#ModRenaming"><span class="hs-identifier hs-type">ModRenaming</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212206"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212206"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-210"></span><span id="withBkpExeSession"><span class="annot"><span class="annottext">withBkpExeSession :: forall a. [(Unit, ModRenaming)] -&gt; BkpM a -&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#withBkpExeSession"><span class="hs-identifier hs-var hs-var">withBkpExeSession</span></a></span></span><span> </span><span id="local-6989586621681211637"><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211637"><span class="hs-identifier hs-var">deps</span></a></span></span><span> </span><span id="local-6989586621681211636"><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211636"><span class="hs-identifier hs-var">do_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-211"></span><span>    </span><span class="annot"><span class="annottext">IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; [(Unit, ModRenaming)]
-&gt; SessionType
-&gt; BkpM a
-&gt; BkpM a
forall a.
IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; [(Unit, ModRenaming)]
-&gt; SessionType
-&gt; BkpM a
-&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#withBkpSession"><span class="hs-identifier hs-var">withBkpSession</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; Maybe UnitPprInfo -&gt; IndefUnitId
forall unit. unit -&gt; Maybe UnitPprInfo -&gt; Indefinite unit
</span><a href="GHC.Unit.Types.html#Indefinite"><span class="hs-identifier hs-var">Indefinite</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; UnitId
</span><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-var">UnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;main&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe UnitPprInfo
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211637"><span class="hs-identifier hs-var">deps</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#ExeSession"><span class="hs-identifier hs-var">ExeSession</span></a></span><span> </span><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211636"><span class="hs-identifier hs-var">do_this</span></a></span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span class="annot"><a href="GHC.Driver.Backpack.html#getSource"><span class="hs-identifier hs-type">getSource</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span id="getSource"><span class="annot"><span class="annottext">getSource :: IndefUnitId -&gt; BkpM (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#getSource"><span class="hs-identifier hs-var hs-var">getSource</span></a></span></span><span> </span><span id="local-6989586621681211634"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211634"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-215"></span><span>    </span><span id="local-6989586621681211633"><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211633"><span class="hs-identifier hs-var">bkp_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
</span><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-var">getBkpEnv</span></a></span><span>
</span><span id="line-216"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IndefUnitId
-&gt; Map IndefUnitId (LHsUnit HsComponentId)
-&gt; Maybe (LHsUnit HsComponentId)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211634"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BkpEnv -&gt; Map IndefUnitId (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#bkp_table"><span class="hs-identifier hs-var hs-var">bkp_table</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211633"><span class="hs-identifier hs-var">bkp_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-217"></span><span>        </span><span class="annot"><span class="annottext">Maybe (LHsUnit HsComponentId)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc -&gt; BkpM (LHsUnit HsComponentId)
forall a. HasCallStack =&gt; FilePath -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;missing needed dependency&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211634"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211628"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211628"><span class="hs-identifier hs-var">lunit</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; BkpM (LHsUnit HsComponentId)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211628"><span class="hs-identifier hs-var">lunit</span></a></span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="annot"><a href="GHC.Driver.Backpack.html#typecheckUnit"><span class="hs-identifier hs-type">typecheckUnit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span id="typecheckUnit"><span class="annot"><span class="annottext">typecheckUnit :: IndefUnitId -&gt; [(ModuleName, Module)] -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#typecheckUnit"><span class="hs-identifier hs-var hs-var">typecheckUnit</span></a></span></span><span> </span><span id="local-6989586621681211627"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211627"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621681211626"><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211626"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-222"></span><span>    </span><span id="local-6989586621681211625"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211625"><span class="hs-identifier hs-var">lunit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; BkpM (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#getSource"><span class="hs-identifier hs-var">getSource</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211627"><span class="hs-identifier hs-var">cid</span></a></span><span>
</span><span id="line-223"></span><span>    </span><span class="annot"><span class="annottext">SessionType
-&gt; IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; LHsUnit HsComponentId
-&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#buildUnit"><span class="hs-identifier hs-var">buildUnit</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211627"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211626"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211625"><span class="hs-identifier hs-var">lunit</span></a></span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span class="annot"><a href="GHC.Driver.Backpack.html#compileUnit"><span class="hs-identifier hs-type">compileUnit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span id="compileUnit"><span class="annot"><span class="annottext">compileUnit :: IndefUnitId -&gt; [(ModuleName, Module)] -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileUnit"><span class="hs-identifier hs-var hs-var">compileUnit</span></a></span></span><span> </span><span id="local-6989586621681211623"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211623"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621681211622"><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211622"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-227"></span><span>    </span><span class="hs-comment">-- Let everyone know we're building this unit</span><span>
</span><span id="line-228"></span><span>    </span><span class="annot"><span class="annottext">Unit -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgUnitId"><span class="hs-identifier hs-var">msgUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; Unit
</span><a href="GHC.Unit.Types.html#mkVirtUnit"><span class="hs-identifier hs-var">mkVirtUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211623"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211622"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-229"></span><span>    </span><span id="local-6989586621681211619"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211619"><span class="hs-identifier hs-var">lunit</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; BkpM (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#getSource"><span class="hs-identifier hs-var">getSource</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211623"><span class="hs-identifier hs-var">cid</span></a></span><span>
</span><span id="line-230"></span><span>    </span><span class="annot"><span class="annottext">SessionType
-&gt; IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; LHsUnit HsComponentId
-&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#buildUnit"><span class="hs-identifier hs-var">buildUnit</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#CompSession"><span class="hs-identifier hs-var">CompSession</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211623"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211622"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211619"><span class="hs-identifier hs-var">lunit</span></a></span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span class="hs-comment">-- | Compute the dependencies with instantiations of a syntactic</span><span>
</span><span id="line-233"></span><span class="hs-comment">-- HsUnit; e.g., wherever you see @dependency p[A=&lt;A&gt;]@ in a</span><span>
</span><span id="line-234"></span><span class="hs-comment">-- unit file, return the 'Unit' corresponding to @p[A=&lt;A&gt;]@.</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- The @include_sigs@ parameter controls whether or not we also</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- include @dependency signature@ declarations in this calculation.</span><span>
</span><span id="line-237"></span><span class="hs-comment">--</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- Invariant: this NEVER returns UnitId.</span><span>
</span><span id="line-239"></span><span class="annot"><a href="GHC.Driver.Backpack.html#hsunitDeps"><span class="hs-identifier hs-type">hsunitDeps</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">{- include sigs -}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#ModRenaming"><span class="hs-identifier hs-type">ModRenaming</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-240"></span><span id="hsunitDeps"><span class="annot"><span class="annottext">hsunitDeps :: Bool -&gt; HsUnit HsComponentId -&gt; [(Unit, ModRenaming)]
</span><a href="GHC.Driver.Backpack.html#hsunitDeps"><span class="hs-identifier hs-var hs-var">hsunitDeps</span></a></span></span><span> </span><span id="local-6989586621681211617"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211617"><span class="hs-identifier hs-var">include_sigs</span></a></span></span><span> </span><span id="local-6989586621681211616"><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211616"><span class="hs-keyword hs-var">unit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsUnitDecl HsComponentId)
 -&gt; [(Unit, ModRenaming)])
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
-&gt; [(Unit, ModRenaming)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitDecl HsComponentId)
-&gt; [(Unit, ModRenaming)]
forall {l}.
GenLocated l (HsUnitDecl HsComponentId) -&gt; [(Unit, ModRenaming)]
</span><a href="#local-6989586621681211614"><span class="hs-identifier hs-var">get_dep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
forall n. HsUnit n -&gt; [LHsUnitDecl n]
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitBody"><span class="hs-identifier hs-var hs-var">hsunitBody</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211616"><span class="hs-keyword hs-var">unit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-241"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-242"></span><span>    </span><span id="local-6989586621681211614"><span class="annot"><span class="annottext">get_dep :: GenLocated l (HsUnitDecl HsComponentId) -&gt; [(Unit, ModRenaming)]
</span><a href="#local-6989586621681211614"><span class="hs-identifier hs-var hs-var">get_dep</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#IncludeD"><span class="hs-identifier hs-type">IncludeD</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#IncludeDecl"><span class="hs-identifier hs-type">IncludeDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211613"><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211613"><span class="hs-identifier hs-var">hsuid</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681211612"><span class="annot"><span class="annottext">Maybe [LRenaming]
</span><a href="#local-6989586621681211612"><span class="hs-identifier hs-var">mb_lrn</span></a></span></span><span> </span><span id="local-6989586621681211611"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211611"><span class="hs-identifier hs-var">is_sig</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211617"><span class="hs-identifier hs-var">include_sigs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211611"><span class="hs-identifier hs-var">is_sig</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnitId HsComponentId -&gt; Unit
</span><a href="GHC.Driver.Backpack.html#convertHsComponentId"><span class="hs-identifier hs-var">convertHsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211613"><span class="hs-identifier hs-var">hsuid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe [LRenaming] -&gt; ModRenaming
forall {l}. Maybe [GenLocated l Renaming] -&gt; ModRenaming
</span><a href="#local-6989586621681211609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [LRenaming]
</span><a href="#local-6989586621681211612"><span class="hs-identifier hs-var">mb_lrn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-244"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-245"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-246"></span><span>        </span><span id="local-6989586621681211609"><span class="annot"><span class="annottext">go :: Maybe [GenLocated l Renaming] -&gt; ModRenaming
</span><a href="#local-6989586621681211609"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe [GenLocated l Renaming]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [(ModuleName, ModuleName)] -&gt; ModRenaming
</span><a href="GHC.Driver.Session.html#ModRenaming"><span class="hs-identifier hs-var">ModRenaming</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-247"></span><span>        </span><span class="annot"><a href="#local-6989586621681211609"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211607"><span class="annot"><span class="annottext">[GenLocated l Renaming]
</span><a href="#local-6989586621681211607"><span class="hs-identifier hs-var">lrns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [(ModuleName, ModuleName)] -&gt; ModRenaming
</span><a href="GHC.Driver.Session.html#ModRenaming"><span class="hs-identifier hs-var">ModRenaming</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(GenLocated l Renaming -&gt; (ModuleName, ModuleName))
-&gt; [GenLocated l Renaming] -&gt; [(ModuleName, ModuleName)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated l Renaming -&gt; (ModuleName, ModuleName)
forall {l}. GenLocated l Renaming -&gt; (ModuleName, ModuleName)
</span><a href="#local-6989586621681211606"><span class="hs-identifier hs-var">convRn</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated l Renaming]
</span><a href="#local-6989586621681211607"><span class="hs-identifier hs-var">lrns</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-249"></span><span>            </span><span id="local-6989586621681211606"><span class="annot"><span class="annottext">convRn :: GenLocated l Renaming -&gt; (ModuleName, ModuleName)
</span><a href="#local-6989586621681211606"><span class="hs-identifier hs-var hs-var">convRn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#Renaming"><span class="hs-identifier hs-type">Renaming</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211604"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211604"><span class="hs-identifier hs-var">from</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (GenLocated SrcSpan ModuleName)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211604"><span class="hs-identifier hs-var">from</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211604"><span class="hs-identifier hs-var">from</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>            </span><span class="annot"><a href="#local-6989586621681211606"><span class="hs-identifier hs-var">convRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#Renaming"><span class="hs-identifier hs-type">Renaming</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211603"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211603"><span class="hs-identifier hs-var">from</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211602"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211602"><span class="hs-identifier hs-var">to</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211603"><span class="hs-identifier hs-var">from</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211602"><span class="hs-identifier hs-var">to</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>    </span><span class="annot"><a href="#local-6989586621681211614"><span class="hs-identifier hs-var">get_dep</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated l (HsUnitDecl HsComponentId)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span class="annot"><a href="GHC.Driver.Backpack.html#buildUnit"><span class="hs-identifier hs-type">buildUnit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#SessionType"><span class="hs-identifier hs-type">SessionType</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span id="buildUnit"><span class="annot"><span class="annottext">buildUnit :: SessionType
-&gt; IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; LHsUnit HsComponentId
-&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#buildUnit"><span class="hs-identifier hs-var hs-var">buildUnit</span></a></span></span><span> </span><span id="local-6989586621681211601"><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span></span><span> </span><span id="local-6989586621681211600"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211600"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621681211599"><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211599"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span id="local-6989586621681211598"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211598"><span class="hs-identifier hs-var">lunit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-255"></span><span>    </span><span class="hs-comment">-- NB: include signature dependencies ONLY when typechecking.</span><span>
</span><span id="line-256"></span><span>    </span><span class="hs-comment">-- If we're compiling, it's not necessary to recursively</span><span>
</span><span id="line-257"></span><span>    </span><span class="hs-comment">-- compile a signature since it isn't going to produce</span><span>
</span><span id="line-258"></span><span>    </span><span class="hs-comment">-- any object files.</span><span>
</span><span id="line-259"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211596"><span class="annot"><span class="annottext">deps_w_rns :: [(Unit, ModRenaming)]
</span><a href="#local-6989586621681211596"><span class="hs-identifier hs-var hs-var">deps_w_rns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; HsUnit HsComponentId -&gt; [(Unit, ModRenaming)]
</span><a href="GHC.Driver.Backpack.html#hsunitDeps"><span class="hs-identifier hs-var">hsunitDeps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType -&gt; SessionType -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211598"><span class="hs-identifier hs-var">lunit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>        </span><span id="local-6989586621681211595"><span class="annot"><span class="annottext">raw_deps :: [Unit]
</span><a href="#local-6989586621681211595"><span class="hs-identifier hs-var hs-var">raw_deps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Unit, ModRenaming) -&gt; Unit) -&gt; [(Unit, ModRenaming)] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Unit, ModRenaming) -&gt; Unit
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211596"><span class="hs-identifier hs-var">deps_w_rns</span></a></span><span>
</span><span id="line-261"></span><span>    </span><span id="local-6989586621681211594"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211594"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-262"></span><span>    </span><span class="hs-comment">-- The compilation dependencies are just the appropriately filled</span><span>
</span><span id="line-263"></span><span>    </span><span class="hs-comment">-- in unit IDs which must be compiled before we can compile.</span><span>
</span><span id="line-264"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211592"><span class="annot"><span class="annottext">hsubst :: ShHoleSubst
</span><a href="#local-6989586621681211592"><span class="hs-identifier hs-var hs-var">hsubst</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)] -&gt; ShHoleSubst
forall key elt. Uniquable key =&gt; [(key, elt)] -&gt; UniqFM key elt
</span><a href="GHC.Types.Unique.FM.html#listToUFM"><span class="hs-identifier hs-var">listToUFM</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211599"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-265"></span><span>        </span><span id="local-6989586621681211591"><span class="annot"><span class="annottext">deps0 :: [Unit]
</span><a href="#local-6989586621681211591"><span class="hs-identifier hs-var hs-var">deps0</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Unit -&gt; Unit) -&gt; [Unit] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; ShHoleSubst -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#renameHoleUnit"><span class="hs-identifier hs-var">renameHoleUnit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211594"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ShHoleSubst
</span><a href="#local-6989586621681211592"><span class="hs-identifier hs-var">hsubst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211595"><span class="hs-identifier hs-var">raw_deps</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span>    </span><span class="hs-comment">-- Build dependencies OR make sure they make sense. BUT NOTE,</span><span>
</span><span id="line-268"></span><span>    </span><span class="hs-comment">-- we can only check the ones that are fully filled; the rest</span><span>
</span><span id="line-269"></span><span>    </span><span class="hs-comment">-- we have to defer until we've typechecked our local signature.</span><span>
</span><span id="line-270"></span><span>    </span><span class="hs-comment">-- TODO: work this into GHC.Driver.Make!!</span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><span class="annottext">[(Int, Unit)] -&gt; ((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; [Unit] -&gt; [(Int, Unit)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211591"><span class="hs-identifier hs-var">deps0</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ())
-&gt; ((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211590"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211590"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211589"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211589"><span class="hs-identifier hs-var">dep</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-272"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-273"></span><span>            </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; BkpM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-274"></span><span>            </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Int, Unit) -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileInclude"><span class="hs-identifier hs-var">compileInclude</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Unit] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211591"><span class="hs-identifier hs-var">deps0</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211590"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211589"><span class="hs-identifier hs-var">dep</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span>    </span><span id="local-6989586621681211587"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211587"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-277"></span><span>    </span><span class="hs-comment">-- IMPROVE IT</span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211586"><span class="annot"><span class="annottext">deps :: [Unit]
</span><a href="#local-6989586621681211586"><span class="hs-identifier hs-var hs-var">deps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Unit -&gt; Unit) -&gt; [Unit] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#improveUnit"><span class="hs-identifier hs-var">improveUnit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211587"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211591"><span class="hs-identifier hs-var">deps0</span></a></span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span>    </span><span id="local-6989586621681211585"><span class="annot"><span class="annottext">Maybe ExternalPackageState
</span><a href="#local-6989586621681211585"><span class="hs-identifier hs-var">mb_old_eps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-281"></span><span>                    </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ExternalPackageState -&gt; Maybe ExternalPackageState)
-&gt; IOEnv BkpEnv ExternalPackageState
-&gt; IOEnv BkpEnv (Maybe ExternalPackageState)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState -&gt; Maybe ExternalPackageState
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv ExternalPackageState
forall (m :: * -&gt; *). GhcMonad m =&gt; m ExternalPackageState
</span><a href="GHC.Driver.Backpack.html#getEpsGhc"><span class="hs-identifier hs-var">getEpsGhc</span></a></span><span>
</span><span id="line-282"></span><span>                    </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe ExternalPackageState
-&gt; IOEnv BkpEnv (Maybe ExternalPackageState)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ExternalPackageState
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span>    </span><span id="local-6989586621681211583"><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><a href="#local-6989586621681211583"><span class="hs-identifier hs-var">conf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; [(Unit, ModRenaming)]
-&gt; SessionType
-&gt; BkpM
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
-&gt; BkpM
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
forall a.
IndefUnitId
-&gt; [(ModuleName, Module)]
-&gt; [(Unit, ModRenaming)]
-&gt; SessionType
-&gt; BkpM a
-&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#withBkpSession"><span class="hs-identifier hs-var">withBkpSession</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211600"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211599"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211596"><span class="hs-identifier hs-var">deps_w_rns</span></a></span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpM
   (GenericUnitInfo
      IndefUnitId PackageId PackageName UnitId ModuleName Module)
 -&gt; BkpM
      (GenericUnitInfo
         IndefUnitId PackageId PackageName UnitId ModuleName Module))
-&gt; BkpM
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
-&gt; BkpM
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span>        </span><span id="local-6989586621681211582"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211582"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-287"></span><span>        </span><span id="local-6989586621681211581"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681211581"><span class="hs-identifier hs-var">mod_graph</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HsUnit HsComponentId -&gt; BkpM ModuleGraph
</span><a href="GHC.Driver.Backpack.html#hsunitModuleGraph"><span class="hs-identifier hs-var">hsunitModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211582"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211598"><span class="hs-identifier hs-var">lunit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>        </span><span class="hs-comment">-- pprTrace &quot;mod_graph&quot; (ppr mod_graph) $ return ()</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span>        </span><span id="local-6989586621681211579"><span class="annot"><span class="annottext">Messager
</span><a href="#local-6989586621681211579"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Messager
</span><a href="GHC.Driver.Backpack.html#mkBackpackMsg"><span class="hs-identifier hs-var">mkBackpackMsg</span></a></span><span>
</span><span id="line-291"></span><span>        </span><span id="local-6989586621681211577"><span class="annot"><span class="annottext">SuccessFlag
</span><a href="#local-6989586621681211577"><span class="hs-identifier hs-var">ok</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LoadHowMuch
-&gt; Maybe Messager -&gt; ModuleGraph -&gt; IOEnv BkpEnv SuccessFlag
forall (m :: * -&gt; *).
GhcMonad m =&gt;
LoadHowMuch -&gt; Maybe Messager -&gt; ModuleGraph -&gt; m SuccessFlag
</span><a href="GHC.Driver.Make.html#load%27"><span class="hs-identifier hs-var">load'</span></a></span><span> </span><span class="annot"><span class="annottext">LoadHowMuch
</span><a href="GHC.Driver.Make.html#LoadAllTargets"><span class="hs-identifier hs-var">LoadAllTargets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Messager -&gt; Maybe Messager
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Messager
</span><a href="#local-6989586621681211579"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681211581"><span class="hs-identifier hs-var">mod_graph</span></a></span><span>
</span><span id="line-292"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; BkpM () -&gt; BkpM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SuccessFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#failed"><span class="hs-identifier hs-var">failed</span></a></span><span> </span><span class="annot"><span class="annottext">SuccessFlag
</span><a href="#local-6989586621681211577"><span class="hs-identifier hs-var">ok</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO () -&gt; BkpM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; BkpM ()) -&gt; IO () -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211568"><span class="annot"><span class="annottext">hi_dir :: FilePath
</span><a href="#local-6989586621681211568"><span class="hs-identifier hs-var hs-var">hi_dir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; Maybe FilePath -&gt; FilePath
forall a. HasCallStack =&gt; FilePath -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hiDir Backpack&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Maybe FilePath -&gt; FilePath) -&gt; Maybe FilePath -&gt; FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#hiDir"><span class="hs-identifier hs-var hs-var">hiDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211582"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-295"></span><span>            </span><span id="local-6989586621681211565"><span class="annot"><span class="annottext">export_mod :: ModSummary -&gt; (ModuleName, Module)
</span><a href="#local-6989586621681211565"><span class="hs-identifier hs-var hs-var">export_mod</span></a></span></span><span> </span><span id="local-6989586621681211564"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211564"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier hs-var">ms_mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211564"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var hs-var">ms_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211564"><span class="hs-identifier hs-var">ms</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>            </span><span class="hs-comment">-- Export everything!</span><span>
</span><span id="line-297"></span><span>            </span><span id="local-6989586621681211559"><span class="annot"><span class="annottext">mods :: [(ModuleName, Module)]
</span><a href="#local-6989586621681211559"><span class="hs-identifier hs-var hs-var">mods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; (ModuleName, Module)
</span><a href="#local-6989586621681211565"><span class="hs-identifier hs-var">export_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211558"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681211558"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211558"><span class="hs-identifier hs-var">ms</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleGraph -&gt; [ModSummary]
</span><a href="GHC.Driver.Types.html#mgModSummaries"><span class="hs-identifier hs-var">mgModSummaries</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681211581"><span class="hs-identifier hs-var">mod_graph</span></a></span><span>
</span><span id="line-298"></span><span>                                   </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; HscSource
</span><a href="GHC.Driver.Types.html#ms_hsc_src"><span class="hs-identifier hs-var hs-var">ms_hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211558"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsSrcFile"><span class="hs-identifier hs-var">HsSrcFile</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span>        </span><span class="hs-comment">-- Compile relevant only</span><span>
</span><span id="line-301"></span><span>        </span><span id="local-6989586621681211555"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211555"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211553"><span class="annot"><span class="annottext">home_mod_infos :: [HomeModInfo]
</span><a href="#local-6989586621681211553"><span class="hs-identifier hs-var hs-var">home_mod_infos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqDFM ModuleName HomeModInfo -&gt; [HomeModInfo]
forall key elt. UniqDFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.DFM.html#eltsUDFM"><span class="hs-identifier hs-var">eltsUDFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; UniqDFM ModuleName HomeModInfo
</span><a href="GHC.Driver.Types.html#hsc_HPT"><span class="hs-identifier hs-var hs-var">hsc_HPT</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211555"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>            </span><span id="local-6989586621681211547"><span class="annot"><span class="annottext">linkables :: [Linkable]
</span><a href="#local-6989586621681211547"><span class="hs-identifier hs-var hs-var">linkables</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HomeModInfo -&gt; Linkable) -&gt; [HomeModInfo] -&gt; [Linkable]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; Maybe Linkable -&gt; Linkable
forall a. HasCallStack =&gt; FilePath -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;bkp link&quot;</span></span><span> </span><span class="annot"><span class="annottext">(Maybe Linkable -&gt; Linkable)
-&gt; (HomeModInfo -&gt; Maybe Linkable) -&gt; HomeModInfo -&gt; Linkable
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; Maybe Linkable
</span><a href="GHC.Driver.Types.html#hm_linkable"><span class="hs-identifier hs-var hs-var">hm_linkable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-304"></span><span>                      </span><span class="annot"><span class="annottext">([HomeModInfo] -&gt; [Linkable])
-&gt; ([HomeModInfo] -&gt; [HomeModInfo]) -&gt; [HomeModInfo] -&gt; [Linkable]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(HomeModInfo -&gt; Bool) -&gt; [HomeModInfo] -&gt; [HomeModInfo]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsSrcFile"><span class="hs-identifier hs-var">HsSrcFile</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(HscSource -&gt; Bool)
-&gt; (HomeModInfo -&gt; HscSource) -&gt; HomeModInfo -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface_ 'ModIfaceFinal -&gt; HscSource
forall (phase :: ModIfacePhase). ModIface_ phase -&gt; HscSource
</span><a href="GHC.Driver.Types.html#mi_hsc_src"><span class="hs-identifier hs-var hs-var">mi_hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">(ModIface_ 'ModIfaceFinal -&gt; HscSource)
-&gt; (HomeModInfo -&gt; ModIface_ 'ModIfaceFinal)
-&gt; HomeModInfo
-&gt; HscSource
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HomeModInfo -&gt; ModIface_ 'ModIfaceFinal
</span><a href="GHC.Driver.Types.html#hm_iface"><span class="hs-identifier hs-var hs-var">hm_iface</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>                      </span><span class="annot"><span class="annottext">([HomeModInfo] -&gt; [Linkable]) -&gt; [HomeModInfo] -&gt; [Linkable]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[HomeModInfo]
</span><a href="#local-6989586621681211553"><span class="hs-identifier hs-var">home_mod_infos</span></a></span><span>
</span><span id="line-306"></span><span>            </span><span id="local-6989586621681211543"><span class="annot"><span class="annottext">getOfiles :: Linkable -&gt; [FilePath]
</span><a href="#local-6989586621681211543"><span class="hs-identifier hs-var hs-var">getOfiles</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Runtime.Linker.Types.html#LM"><span class="hs-identifier hs-type">LM</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Module
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211541"><span class="annot"><span class="annottext">[Unlinked]
</span><a href="#local-6989586621681211541"><span class="hs-identifier hs-var">us</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Unlinked -&gt; FilePath) -&gt; [Unlinked] -&gt; [FilePath]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Unlinked -&gt; FilePath
</span><a href="GHC.Driver.Types.html#nameOfObject"><span class="hs-identifier hs-var">nameOfObject</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Unlinked -&gt; Bool) -&gt; [Unlinked] -&gt; [Unlinked]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">Unlinked -&gt; Bool
</span><a href="GHC.Driver.Types.html#isObject"><span class="hs-identifier hs-var">isObject</span></a></span><span> </span><span class="annot"><span class="annottext">[Unlinked]
</span><a href="#local-6989586621681211541"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>            </span><span id="local-6989586621681211537"><span class="annot"><span class="annottext">obj_files :: [FilePath]
</span><a href="#local-6989586621681211537"><span class="hs-identifier hs-var hs-var">obj_files</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Linkable -&gt; [FilePath]) -&gt; [Linkable] -&gt; [FilePath]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">Linkable -&gt; [FilePath]
</span><a href="#local-6989586621681211543"><span class="hs-identifier hs-var">getOfiles</span></a></span><span> </span><span class="annot"><span class="annottext">[Linkable]
</span><a href="#local-6989586621681211547"><span class="hs-identifier hs-var">linkables</span></a></span><span>
</span><span id="line-308"></span><span>            </span><span id="local-6989586621681211536"><span class="annot"><span class="annottext">state :: UnitState
</span><a href="#local-6989586621681211536"><span class="hs-identifier hs-var hs-var">state</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211555"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>
</span><span id="line-310"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211535"><span class="annot"><span class="annottext">compat_fs :: FastString
</span><a href="#local-6989586621681211535"><span class="hs-identifier hs-var hs-var">compat_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitIdFS"><span class="hs-identifier hs-var hs-var">unitIdFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; UnitId
forall unit. Indefinite unit -&gt; unit
</span><a href="GHC.Unit.Types.html#indefUnit"><span class="hs-identifier hs-var hs-var">indefUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211600"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>            </span><span id="local-6989586621681211534"><span class="annot"><span class="annottext">compat_pn :: PackageName
</span><a href="#local-6989586621681211534"><span class="hs-identifier hs-var hs-var">compat_pn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; PackageName
</span><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-var">PackageName</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211535"><span class="hs-identifier hs-var">compat_fs</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>        </span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
-&gt; BkpM
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo :: forall compid srcpkgid srcpkgname uid modulename mod.
uid
-&gt; compid
-&gt; [(modulename, mod)]
-&gt; srcpkgid
-&gt; srcpkgname
-&gt; Version
-&gt; Maybe srcpkgname
-&gt; FilePath
-&gt; [uid]
-&gt; [(uid, FilePath)]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [FilePath]
-&gt; [(modulename, Maybe mod)]
-&gt; [modulename]
-&gt; Bool
-&gt; Bool
-&gt; Bool
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-314"></span><span>            </span><span class="hs-comment">-- Stub data</span><span>
</span><span id="line-315"></span><span>            </span><span class="annot"><span class="annottext">unitAbiHash :: FilePath
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitAbiHash"><span class="hs-identifier hs-var">unitAbiHash</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-316"></span><span>            </span><span class="annot"><span class="annottext">unitPackageId :: PackageId
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitPackageId"><span class="hs-identifier hs-var">unitPackageId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; PackageId
</span><a href="GHC.Unit.Info.html#PackageId"><span class="hs-identifier hs-var">PackageId</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211535"><span class="hs-identifier hs-var">compat_fs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-317"></span><span>            </span><span class="annot"><span class="annottext">unitPackageName :: PackageName
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitPackageName"><span class="hs-identifier hs-var">unitPackageName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211534"><span class="hs-identifier hs-var">compat_pn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-318"></span><span>            </span><span class="annot"><span class="annottext">unitPackageVersion :: Version
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitPackageVersion"><span class="hs-identifier hs-var">unitPackageVersion</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int] -&gt; Version
</span><a href="../../base/src/Data.Version.html#makeVersion"><span class="hs-identifier hs-var">makeVersion</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-319"></span><span>            </span><span class="annot"><span class="annottext">unitId :: UnitId
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitId"><span class="hs-identifier hs-var">unitId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; UnitId
</span><a href="GHC.Unit.Types.html#toUnitId"><span class="hs-identifier hs-var">toUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211582"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-320"></span><span>            </span><span class="annot"><span class="annottext">unitComponentName :: Maybe PackageName
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitComponentName"><span class="hs-identifier hs-var">unitComponentName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe PackageName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-321"></span><span>            </span><span class="annot"><span class="annottext">unitInstanceOf :: IndefUnitId
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitInstanceOf"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211600"><span class="hs-identifier hs-var">cid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-322"></span><span>            </span><span class="annot"><span class="annottext">unitInstantiations :: [(ModuleName, Module)]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitInstantiations"><span class="hs-identifier hs-var">unitInstantiations</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211599"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-323"></span><span>            </span><span class="hs-comment">-- Slight inefficiency here haha</span><span>
</span><span id="line-324"></span><span>            </span><span class="annot"><span class="annottext">unitExposedModules :: [(ModuleName, Maybe Module)]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitExposedModules"><span class="hs-identifier hs-var">unitExposedModules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((ModuleName, Module) -&gt; (ModuleName, Maybe Module))
-&gt; [(ModuleName, Module)] -&gt; [(ModuleName, Maybe Module)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211518"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211518"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681211517"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211517"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211518"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Module -&gt; Maybe Module
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211517"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211559"><span class="hs-identifier hs-var">mods</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-325"></span><span>            </span><span class="annot"><span class="annottext">unitHiddenModules :: [ModuleName]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitHiddenModules"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- TODO: doc only</span><span>
</span><span id="line-326"></span><span>            </span><span class="annot"><span class="annottext">unitDepends :: [UnitId]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitDepends"><span class="hs-identifier hs-var">unitDepends</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-327"></span><span>                        </span><span class="hs-comment">-- Technically, we should state that we depend</span><span>
</span><span id="line-328"></span><span>                        </span><span class="hs-comment">-- on all the indefinite libraries we used to</span><span>
</span><span id="line-329"></span><span>                        </span><span class="hs-comment">-- typecheck this.  However, this field isn't</span><span>
</span><span id="line-330"></span><span>                        </span><span class="hs-comment">-- really used for anything, so we leave it</span><span>
</span><span id="line-331"></span><span>                        </span><span class="hs-comment">-- blank for now.</span><span>
</span><span id="line-332"></span><span>                        </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-333"></span><span>                        </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Unit -&gt; UnitId) -&gt; [Unit] -&gt; [UnitId]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; UnitId
</span><a href="GHC.Unit.Types.html#toUnitId"><span class="hs-identifier hs-var">toUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">(Unit -&gt; UnitId) -&gt; (Unit -&gt; Unit) -&gt; Unit -&gt; UnitId
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Unit
</span><a href="GHC.Unit.State.html#unwireUnit"><span class="hs-identifier hs-var">unwireUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211536"><span class="hs-identifier hs-var">state</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>                                </span><span class="annot"><span class="annottext">([Unit] -&gt; [UnitId]) -&gt; [Unit] -&gt; [UnitId]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211586"><span class="hs-identifier hs-var">deps</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit] -&gt; [Unit] -&gt; [Unit]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211513"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-335"></span><span>                                          </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211513"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211513"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
</span><a href="#local-6989586621681211599"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-336"></span><span>                                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Bool
forall u. GenModule (GenUnit u) -&gt; Bool
</span><a href="GHC.Unit.Module.html#isHoleModule"><span class="hs-identifier hs-var">isHoleModule</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211513"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-337"></span><span>            </span><span class="annot"><span class="annottext">unitAbiDepends :: [(UnitId, FilePath)]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitAbiDepends"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-338"></span><span>            </span><span class="annot"><span class="annottext">unitLinkerOptions :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitLinkerOptions"><span class="hs-identifier hs-var">unitLinkerOptions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-339"></span><span>                                 </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-340"></span><span>                                 </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[FilePath]
</span><a href="#local-6989586621681211537"><span class="hs-identifier hs-var">obj_files</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-341"></span><span>            </span><span class="annot"><span class="annottext">unitImportDirs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitImportDirs"><span class="hs-identifier hs-var">unitImportDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211568"><span class="hs-identifier hs-var">hi_dir</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-342"></span><span>            </span><span class="annot"><span class="annottext">unitIsExposed :: Bool
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIsExposed"><span class="hs-identifier hs-var">unitIsExposed</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-343"></span><span>            </span><span class="annot"><span class="annottext">unitIsIndefinite :: Bool
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIsIndefinite"><span class="hs-identifier hs-var">unitIsIndefinite</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SessionType
</span><a href="#local-6989586621681211601"><span class="hs-identifier hs-var">session</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-344"></span><span>                                 </span><span class="annot"><span class="annottext">SessionType
</span><a href="GHC.Driver.Backpack.html#TcSession"><span class="hs-identifier hs-var">TcSession</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-345"></span><span>                                 </span><span class="annot"><span class="annottext">SessionType
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-346"></span><span>            </span><span class="hs-comment">-- nope</span><span>
</span><span id="line-347"></span><span>            </span><span class="annot"><span class="annottext">unitLibraries :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitLibraries"><span class="hs-identifier hs-var">unitLibraries</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-348"></span><span>            </span><span class="annot"><span class="annottext">unitExtDepLibsSys :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitExtDepLibsSys"><span class="hs-identifier hs-var">unitExtDepLibsSys</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-349"></span><span>            </span><span class="annot"><span class="annottext">unitExtDepLibsGhc :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitExtDepLibsGhc"><span class="hs-identifier hs-var">unitExtDepLibsGhc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-350"></span><span>            </span><span class="annot"><span class="annottext">unitLibraryDynDirs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitLibraryDynDirs"><span class="hs-identifier hs-var">unitLibraryDynDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-351"></span><span>            </span><span class="annot"><span class="annottext">unitLibraryDirs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitLibraryDirs"><span class="hs-identifier hs-var">unitLibraryDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-352"></span><span>            </span><span class="annot"><span class="annottext">unitExtDepFrameworks :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitExtDepFrameworks"><span class="hs-identifier hs-var">unitExtDepFrameworks</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-353"></span><span>            </span><span class="annot"><span class="annottext">unitExtDepFrameworkDirs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitExtDepFrameworkDirs"><span class="hs-identifier hs-var">unitExtDepFrameworkDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-354"></span><span>            </span><span class="annot"><span class="annottext">unitCcOptions :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitCcOptions"><span class="hs-identifier hs-var">unitCcOptions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-355"></span><span>            </span><span class="annot"><span class="annottext">unitIncludes :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIncludes"><span class="hs-identifier hs-var">unitIncludes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-356"></span><span>            </span><span class="annot"><span class="annottext">unitIncludeDirs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIncludeDirs"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-357"></span><span>            </span><span class="annot"><span class="annottext">unitHaddockInterfaces :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitHaddockInterfaces"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-358"></span><span>            </span><span class="annot"><span class="annottext">unitHaddockHTMLs :: [FilePath]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitHaddockHTMLs"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-359"></span><span>            </span><span class="annot"><span class="annottext">unitIsTrusted :: Bool
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitIsTrusted"><span class="hs-identifier hs-var">unitIsTrusted</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-360"></span><span>            </span><span class="hs-special">}</span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span>    </span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
-&gt; BkpM ()
forall (m :: * -&gt; *).
GhcMonad m =&gt;
GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
-&gt; m ()
</span><a href="GHC.Driver.Backpack.html#addPackage"><span class="hs-identifier hs-var">addPackage</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><a href="#local-6989586621681211583"><span class="hs-identifier hs-var">conf</span></a></span><span>
</span><span id="line-364"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ExternalPackageState
</span><a href="#local-6989586621681211585"><span class="hs-identifier hs-var">mb_old_eps</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-365"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211492"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681211492"><span class="hs-identifier hs-var">old_eps</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(ExternalPackageState -&gt; ExternalPackageState) -&gt; BkpM ()
forall (m :: * -&gt; *).
GhcMonad m =&gt;
(ExternalPackageState -&gt; ExternalPackageState) -&gt; m ()
</span><a href="GHC.Driver.Backpack.html#updateEpsGhc_"><span class="hs-identifier hs-var">updateEpsGhc_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState
-&gt; ExternalPackageState -&gt; ExternalPackageState
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681211492"><span class="hs-identifier hs-var">old_eps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span>        </span><span class="annot"><span class="annottext">Maybe ExternalPackageState
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; BkpM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>
</span><span id="line-368"></span><span class="annot"><a href="GHC.Driver.Backpack.html#compileExe"><span class="hs-identifier hs-type">compileExe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span id="compileExe"><span class="annot"><span class="annottext">compileExe :: LHsUnit HsComponentId -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileExe"><span class="hs-identifier hs-var hs-var">compileExe</span></a></span></span><span> </span><span id="local-6989586621681211489"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211489"><span class="hs-identifier hs-var">lunit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-370"></span><span>    </span><span class="annot"><span class="annottext">Unit -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgUnitId"><span class="hs-identifier hs-var">msgUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="GHC.Unit.Types.html#mainUnit"><span class="hs-identifier hs-var">mainUnit</span></a></span><span>
</span><span id="line-371"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211487"><span class="annot"><span class="annottext">deps_w_rns :: [(Unit, ModRenaming)]
</span><a href="#local-6989586621681211487"><span class="hs-identifier hs-var hs-var">deps_w_rns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; HsUnit HsComponentId -&gt; [(Unit, ModRenaming)]
</span><a href="GHC.Driver.Backpack.html#hsunitDeps"><span class="hs-identifier hs-var">hsunitDeps</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211489"><span class="hs-identifier hs-var">lunit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>        </span><span id="local-6989586621681211486"><span class="annot"><span class="annottext">deps :: [Unit]
</span><a href="#local-6989586621681211486"><span class="hs-identifier hs-var hs-var">deps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Unit, ModRenaming) -&gt; Unit) -&gt; [(Unit, ModRenaming)] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Unit, ModRenaming) -&gt; Unit
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211487"><span class="hs-identifier hs-var">deps_w_rns</span></a></span><span>
</span><span id="line-373"></span><span>        </span><span class="hs-comment">-- no renaming necessary</span><span>
</span><span id="line-374"></span><span>    </span><span class="annot"><span class="annottext">[(Int, Unit)] -&gt; ((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; [Unit] -&gt; [(Int, Unit)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-glyph">..</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211486"><span class="hs-identifier hs-var">deps</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ())
-&gt; ((Int, Unit) -&gt; BkpM ()) -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211485"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211485"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211484"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211484"><span class="hs-identifier hs-var">dep</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-375"></span><span>        </span><span class="annot"><span class="annottext">Int -&gt; (Int, Unit) -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileInclude"><span class="hs-identifier hs-var">compileInclude</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Unit] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621681211486"><span class="hs-identifier hs-var">deps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211485"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211484"><span class="hs-identifier hs-var">dep</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>    </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)] -&gt; BkpM () -&gt; BkpM ()
forall a. [(Unit, ModRenaming)] -&gt; BkpM a -&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#withBkpExeSession"><span class="hs-identifier hs-var">withBkpExeSession</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, ModRenaming)]
</span><a href="#local-6989586621681211487"><span class="hs-identifier hs-var">deps_w_rns</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpM () -&gt; BkpM ()) -&gt; BkpM () -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-377"></span><span>        </span><span id="local-6989586621681211483"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211483"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-378"></span><span>        </span><span id="local-6989586621681211482"><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681211482"><span class="hs-identifier hs-var">mod_graph</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HsUnit HsComponentId -&gt; BkpM ModuleGraph
</span><a href="GHC.Driver.Backpack.html#hsunitModuleGraph"><span class="hs-identifier hs-var">hsunitModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211483"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211489"><span class="hs-identifier hs-var">lunit</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>        </span><span id="local-6989586621681211481"><span class="annot"><span class="annottext">Messager
</span><a href="#local-6989586621681211481"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Messager
</span><a href="GHC.Driver.Backpack.html#mkBackpackMsg"><span class="hs-identifier hs-var">mkBackpackMsg</span></a></span><span>
</span><span id="line-380"></span><span>        </span><span id="local-6989586621681211480"><span class="annot"><span class="annottext">SuccessFlag
</span><a href="#local-6989586621681211480"><span class="hs-identifier hs-var">ok</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LoadHowMuch
-&gt; Maybe Messager -&gt; ModuleGraph -&gt; IOEnv BkpEnv SuccessFlag
forall (m :: * -&gt; *).
GhcMonad m =&gt;
LoadHowMuch -&gt; Maybe Messager -&gt; ModuleGraph -&gt; m SuccessFlag
</span><a href="GHC.Driver.Make.html#load%27"><span class="hs-identifier hs-var">load'</span></a></span><span> </span><span class="annot"><span class="annottext">LoadHowMuch
</span><a href="GHC.Driver.Make.html#LoadAllTargets"><span class="hs-identifier hs-var">LoadAllTargets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Messager -&gt; Maybe Messager
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Messager
</span><a href="#local-6989586621681211481"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleGraph
</span><a href="#local-6989586621681211482"><span class="hs-identifier hs-var">mod_graph</span></a></span><span>
</span><span id="line-381"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; BkpM () -&gt; BkpM ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SuccessFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#failed"><span class="hs-identifier hs-var">failed</span></a></span><span> </span><span class="annot"><span class="annottext">SuccessFlag
</span><a href="#local-6989586621681211480"><span class="hs-identifier hs-var">ok</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO () -&gt; BkpM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; BkpM ()) -&gt; IO () -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCode -&gt; IO ()
forall a. ExitCode -&gt; IO a
</span><a href="../../base/src/System.Exit.html#exitWith"><span class="hs-identifier hs-var">exitWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; ExitCode
</span><a href="../../base/src/GHC.IO.Exception.html#ExitFailure"><span class="hs-identifier hs-var">ExitFailure</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">-- | Register a new virtual unit database containing a single unit</span><span>
</span><span id="line-384"></span><span id="local-6989586621681212149"><span class="annot"><a href="GHC.Driver.Backpack.html#addPackage"><span class="hs-identifier hs-type">addPackage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#UnitInfo"><span class="hs-identifier hs-type">UnitInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681212149"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-385"></span><span id="addPackage"><span class="annot"><span class="annottext">addPackage :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
-&gt; m ()
</span><a href="GHC.Driver.Backpack.html#addPackage"><span class="hs-identifier hs-var hs-var">addPackage</span></a></span></span><span> </span><span id="local-6989586621681211466"><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><a href="#local-6989586621681211466"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-386"></span><span>    </span><span id="local-6989586621681211465"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211465"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m DynFlags
forall (m :: * -&gt; *). GhcMonad m =&gt; m DynFlags
</span><a href="GHC.Driver.Monad.html#getSessionDynFlags"><span class="hs-identifier hs-var">GHC.getSessionDynFlags</span></a></span><span>
</span><span id="line-387"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe [UnitDatabase UnitId]
</span><a href="GHC.Driver.Session.html#unitDatabases"><span class="hs-identifier hs-var hs-var">unitDatabases</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211465"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-388"></span><span>        </span><span class="annot"><span class="annottext">Maybe [UnitDatabase UnitId]
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; m ()
forall a. FilePath -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;addPackage: called too early&quot;</span></span><span>
</span><span id="line-389"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211463"><span class="annot"><span class="annottext">[UnitDatabase UnitId]
</span><a href="#local-6989586621681211463"><span class="hs-identifier hs-var">dbs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-390"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211461"><span class="annot"><span class="annottext">newdb :: UnitDatabase UnitId
</span><a href="#local-6989586621681211461"><span class="hs-identifier hs-var hs-var">newdb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitDatabase :: forall unit. FilePath -&gt; [GenUnitInfo unit] -&gt; UnitDatabase unit
</span><a href="GHC.Unit.State.html#UnitDatabase"><span class="hs-identifier hs-type">UnitDatabase</span></a></span><span>
</span><span id="line-391"></span><span>               </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">unitDatabasePath :: FilePath
</span><a href="GHC.Unit.State.html#unitDatabasePath"><span class="hs-identifier hs-var">unitDatabasePath</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;(in memory &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#showSDoc"><span class="hs-identifier hs-var">showSDoc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211465"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
-&gt; UnitId
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; uid
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitId"><span class="hs-identifier hs-var hs-var">unitId</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><a href="#local-6989586621681211466"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;)&quot;</span></span><span>
</span><span id="line-392"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitDatabaseUnits :: [GenericUnitInfo
   IndefUnitId PackageId PackageName UnitId ModuleName Module]
</span><a href="GHC.Unit.State.html#unitDatabaseUnits"><span class="hs-identifier hs-var">unitDatabaseUnits</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><a href="#local-6989586621681211466"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-393"></span><span>               </span><span class="hs-special">}</span><span>
</span><span id="line-394"></span><span>         </span><span class="annot"><span class="annottext">DynFlags -&gt; m ()
forall (m :: * -&gt; *). GhcMonad m =&gt; DynFlags -&gt; m ()
</span><a href="GHC.html#setSessionDynFlags"><span class="hs-identifier hs-var">GHC.setSessionDynFlags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211465"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">unitDatabases :: Maybe [UnitDatabase UnitId]
</span><a href="GHC.Driver.Session.html#unitDatabases"><span class="hs-identifier hs-var">unitDatabases</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[UnitDatabase UnitId] -&gt; Maybe [UnitDatabase UnitId]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[UnitDatabase UnitId]
</span><a href="#local-6989586621681211463"><span class="hs-identifier hs-var">dbs</span></a></span><span> </span><span class="annot"><span class="annottext">[UnitDatabase UnitId]
-&gt; [UnitDatabase UnitId] -&gt; [UnitDatabase UnitId]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">UnitDatabase UnitId
</span><a href="#local-6989586621681211461"><span class="hs-identifier hs-var">newdb</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="annot"><a href="GHC.Driver.Backpack.html#compileInclude"><span class="hs-identifier hs-type">compileInclude</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-397"></span><span id="compileInclude"><span class="annot"><span class="annottext">compileInclude :: Int -&gt; (Int, Unit) -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileInclude"><span class="hs-identifier hs-var hs-var">compileInclude</span></a></span></span><span> </span><span id="local-6989586621681211457"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211457"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211456"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211456"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211455"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211455"><span class="hs-identifier hs-var">uid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-398"></span><span>    </span><span id="local-6989586621681211454"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211454"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-399"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211453"><span class="annot"><span class="annottext">pkgs :: UnitState
</span><a href="#local-6989586621681211453"><span class="hs-identifier hs-var hs-var">pkgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211454"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>    </span><span class="annot"><span class="annottext">(Int, Int) -&gt; Unit -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgInclude"><span class="hs-identifier hs-var">msgInclude</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211456"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211457"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211455"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-401"></span><span>    </span><span class="hs-comment">-- Check if we've compiled it already</span><span>
</span><span id="line-402"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211455"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-403"></span><span>      </span><span class="annot"><span class="annottext">Unit
</span><a href="GHC.Unit.Types.html#HoleUnit"><span class="hs-identifier hs-var">HoleUnit</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; BkpM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>      </span><span class="annot"><a href="GHC.Unit.Types.html#RealUnit"><span class="hs-identifier hs-type">RealUnit</span></a></span><span> </span><span class="annot"><span class="annottext">Definite UnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; BkpM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-405"></span><span>      </span><span class="annot"><a href="GHC.Unit.Types.html#VirtUnit"><span class="hs-identifier hs-type">VirtUnit</span></a></span><span> </span><span id="local-6989586621681211448"><span class="annot"><span class="annottext">GenInstantiatedUnit UnitId
</span><a href="#local-6989586621681211448"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitState
-&gt; Unit
-&gt; Maybe
     (GenericUnitInfo
        IndefUnitId PackageId PackageName UnitId ModuleName Module)
</span><a href="GHC.Unit.State.html#lookupUnit"><span class="hs-identifier hs-var">lookupUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211453"><span class="hs-identifier hs-var">pkgs</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211455"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-406"></span><span>        </span><span class="annot"><span class="annottext">Maybe
  (GenericUnitInfo
     IndefUnitId PackageId PackageName UnitId ModuleName Module)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BkpM () -&gt; BkpM ()
forall a. BkpM a -&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#innerBkpM"><span class="hs-identifier hs-var">innerBkpM</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpM () -&gt; BkpM ()) -&gt; BkpM () -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#compileUnit"><span class="hs-identifier hs-var">compileUnit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenInstantiatedUnit UnitId -&gt; IndefUnitId
forall unit. GenInstantiatedUnit unit -&gt; Indefinite unit
</span><a href="GHC.Unit.Types.html#instUnitInstanceOf"><span class="hs-identifier hs-var hs-var">instUnitInstanceOf</span></a></span><span> </span><span class="annot"><span class="annottext">GenInstantiatedUnit UnitId
</span><a href="#local-6989586621681211448"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenInstantiatedUnit UnitId -&gt; [(ModuleName, Module)]
forall unit. GenInstantiatedUnit unit -&gt; GenInstantiations unit
</span><a href="GHC.Unit.Types.html#instUnitInsts"><span class="hs-identifier hs-var hs-var">instUnitInsts</span></a></span><span> </span><span class="annot"><span class="annottext">GenInstantiatedUnit UnitId
</span><a href="#local-6989586621681211448"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo
  IndefUnitId PackageId PackageName UnitId ModuleName Module
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; BkpM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-410"></span><span class="hs-comment">-- Backpack monad</span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="hs-comment">-- | Backpack monad is a 'GhcMonad' which also maintains a little extra state</span><span>
</span><span id="line-413"></span><span class="hs-comment">-- beyond the 'Session', c.f. 'BkpEnv'.</span><span>
</span><span id="line-414"></span><span class="hs-keyword">type</span><span> </span><span id="BkpM"><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-var">BkpM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Data.IOEnv.html#IOEnv"><span class="hs-identifier hs-type">IOEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpEnv"><span class="hs-identifier hs-type">BkpEnv</span></a></span><span>
</span><span id="line-415"></span><span>
</span><span id="line-416"></span><span class="hs-comment">-- | Backpack environment.  NB: this has a 'Session' and not an 'HscEnv',</span><span>
</span><span id="line-417"></span><span class="hs-comment">-- because we are going to update the 'HscEnv' as we go.</span><span>
</span><span id="line-418"></span><span class="hs-keyword">data</span><span> </span><span id="BkpEnv"><span class="annot"><a href="GHC.Driver.Backpack.html#BkpEnv"><span class="hs-identifier hs-var">BkpEnv</span></a></span></span><span>
</span><span id="line-419"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="BkpEnv"><span class="annot"><a href="GHC.Driver.Backpack.html#BkpEnv"><span class="hs-identifier hs-var">BkpEnv</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-420"></span><span>        </span><span class="hs-comment">-- | The session</span><span>
</span><span id="line-421"></span><span>        </span><span id="bkp_session"><span class="annot"><span class="annottext">BkpEnv -&gt; Session
</span><a href="GHC.Driver.Backpack.html#bkp_session"><span class="hs-identifier hs-var hs-var">bkp_session</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-type">Session</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-422"></span><span>        </span><span class="hs-comment">-- | The filename of the bkp file we're compiling</span><span>
</span><span id="line-423"></span><span>        </span><span id="bkp_filename"><span class="annot"><span class="annottext">BkpEnv -&gt; FilePath
</span><a href="GHC.Driver.Backpack.html#bkp_filename"><span class="hs-identifier hs-var hs-var">bkp_filename</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-424"></span><span>        </span><span class="hs-comment">-- | Table of source units which we know how to compile</span><span>
</span><span id="line-425"></span><span>        </span><span id="bkp_table"><span class="annot"><span class="annottext">BkpEnv -&gt; Map IndefUnitId (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#bkp_table"><span class="hs-identifier hs-var hs-var">bkp_table</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-426"></span><span>        </span><span class="hs-comment">-- | When a package we are compiling includes another package</span><span>
</span><span id="line-427"></span><span>        </span><span class="hs-comment">-- which has not been compiled, we bump the level and compile</span><span>
</span><span id="line-428"></span><span>        </span><span class="hs-comment">-- that.</span><span>
</span><span id="line-429"></span><span>        </span><span id="bkp_level"><span class="annot"><span class="annottext">BkpEnv -&gt; Int
</span><a href="GHC.Driver.Backpack.html#bkp_level"><span class="hs-identifier hs-var hs-var">bkp_level</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-430"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-431"></span><span>
</span><span id="line-432"></span><span class="hs-comment">-- Blah, to get rid of the default instance for IOEnv</span><span>
</span><span id="line-433"></span><span class="hs-comment">-- TODO: just make a proper new monad for BkpM, rather than use IOEnv</span><span>
</span><span id="line-434"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-pragma">{-# OVERLAPPING</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#HasDynFlags"><span class="hs-identifier hs-type">HasDynFlags</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-435"></span><span>    </span><span id="local-6989586621681211436"><span class="annot"><span class="annottext">getDynFlags :: IOEnv BkpEnv DynFlags
</span><a href="#local-6989586621681211436"><span class="hs-identifier hs-var hs-var hs-var hs-var">getDynFlags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HscEnv -&gt; DynFlags)
-&gt; IOEnv BkpEnv HscEnv -&gt; IOEnv BkpEnv DynFlags
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-438"></span><span>    </span><span id="local-6989586621681211418"><span class="annot"><span class="annottext">getSession :: IOEnv BkpEnv HscEnv
</span><a href="#local-6989586621681211418"><span class="hs-identifier hs-var hs-var hs-var hs-var">getSession</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-439"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-type">Session</span></a></span><span> </span><span id="local-6989586621681211416"><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681211416"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(BkpEnv -&gt; Session) -&gt; BkpM BkpEnv -&gt; IOEnv BkpEnv Session
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv -&gt; Session
</span><a href="GHC.Driver.Backpack.html#bkp_session"><span class="hs-identifier hs-var hs-var">bkp_session</span></a></span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
forall env. IOEnv env env
</span><a href="GHC.Data.IOEnv.html#getEnv"><span class="hs-identifier hs-var">getEnv</span></a></span><span>
</span><span id="line-440"></span><span>        </span><span class="annot"><span class="annottext">IORef HscEnv -&gt; IOEnv BkpEnv HscEnv
forall a env. IORef a -&gt; IOEnv env a
</span><a href="GHC.Data.IOEnv.html#readMutVar"><span class="hs-identifier hs-var">readMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681211416"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-441"></span><span>    </span><span id="local-6989586621681211411"><span class="annot"><span class="annottext">setSession :: HscEnv -&gt; BkpM ()
</span><a href="GHC.Driver.Monad.html#setSession"><span class="hs-identifier hs-var hs-var hs-var hs-var">setSession</span></a></span></span><span> </span><span id="local-6989586621681211409"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211409"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-442"></span><span>        </span><span class="annot"><a href="GHC.Driver.Monad.html#Session"><span class="hs-identifier hs-type">Session</span></a></span><span> </span><span id="local-6989586621681211408"><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681211408"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(BkpEnv -&gt; Session) -&gt; BkpM BkpEnv -&gt; IOEnv BkpEnv Session
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv -&gt; Session
</span><a href="GHC.Driver.Backpack.html#bkp_session"><span class="hs-identifier hs-var hs-var">bkp_session</span></a></span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
forall env. IOEnv env env
</span><a href="GHC.Data.IOEnv.html#getEnv"><span class="hs-identifier hs-var">getEnv</span></a></span><span>
</span><span id="line-443"></span><span>        </span><span class="annot"><span class="annottext">IORef HscEnv -&gt; HscEnv -&gt; BkpM ()
forall a env. IORef a -&gt; a -&gt; IOEnv env ()
</span><a href="GHC.Data.IOEnv.html#writeMutVar"><span class="hs-identifier hs-var">writeMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef HscEnv
</span><a href="#local-6989586621681211408"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211409"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="hs-comment">-- | Get the current 'BkpEnv'.</span><span>
</span><span id="line-446"></span><span class="annot"><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-type">getBkpEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpEnv"><span class="hs-identifier hs-type">BkpEnv</span></a></span><span>
</span><span id="line-447"></span><span id="getBkpEnv"><span class="annot"><span class="annottext">getBkpEnv :: BkpM BkpEnv
</span><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-var hs-var">getBkpEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
forall env. IOEnv env env
</span><a href="GHC.Data.IOEnv.html#getEnv"><span class="hs-identifier hs-var">getEnv</span></a></span><span>
</span><span id="line-448"></span><span>
</span><span id="line-449"></span><span class="hs-comment">-- | Get the nesting level, when recursively compiling modules.</span><span>
</span><span id="line-450"></span><span class="annot"><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-type">getBkpLevel</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-451"></span><span id="getBkpLevel"><span class="annot"><span class="annottext">getBkpLevel :: BkpM Int
</span><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-var hs-var">getBkpLevel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BkpEnv -&gt; Int
</span><a href="GHC.Driver.Backpack.html#bkp_level"><span class="hs-identifier hs-var hs-var">bkp_level</span></a></span><span> </span><span class="annot"><span class="annottext">(BkpEnv -&gt; Int) -&gt; BkpM BkpEnv -&gt; BkpM Int
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
</span><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-var">getBkpEnv</span></a></span><span>
</span><span id="line-452"></span><span>
</span><span id="line-453"></span><span class="hs-comment">-- | Apply a function on 'DynFlags' on an 'HscEnv'</span><span>
</span><span id="line-454"></span><span class="annot"><a href="GHC.Driver.Backpack.html#overHscDynFlags"><span class="hs-identifier hs-type">overHscDynFlags</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-455"></span><span id="overHscDynFlags"><span class="annot"><span class="annottext">overHscDynFlags :: (DynFlags -&gt; DynFlags) -&gt; HscEnv -&gt; HscEnv
</span><a href="GHC.Driver.Backpack.html#overHscDynFlags"><span class="hs-identifier hs-var hs-var">overHscDynFlags</span></a></span></span><span> </span><span id="local-6989586621681211405"><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags
</span><a href="#local-6989586621681211405"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681211404"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211404"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211404"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsc_dflags :: DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var">hsc_dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DynFlags
</span><a href="#local-6989586621681211405"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211404"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="hs-comment">-- | Run a 'BkpM' computation, with the nesting level bumped one.</span><span>
</span><span id="line-458"></span><span id="local-6989586621681212261"><span class="annot"><a href="GHC.Driver.Backpack.html#innerBkpM"><span class="hs-identifier hs-type">innerBkpM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212261"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212261"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-459"></span><span id="innerBkpM"><span class="annot"><span class="annottext">innerBkpM :: forall a. BkpM a -&gt; BkpM a
</span><a href="GHC.Driver.Backpack.html#innerBkpM"><span class="hs-identifier hs-var hs-var">innerBkpM</span></a></span></span><span> </span><span id="local-6989586621681211401"><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211401"><span class="hs-identifier hs-var">do_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-460"></span><span>    </span><span class="hs-comment">-- NB: withTempSession mutates, so we don't have to worry</span><span>
</span><span id="line-461"></span><span>    </span><span class="hs-comment">-- about bkp_session being stale.</span><span>
</span><span id="line-462"></span><span>    </span><span class="annot"><span class="annottext">(BkpEnv -&gt; BkpEnv) -&gt; BkpM a -&gt; BkpM a
forall env env' a. (env -&gt; env') -&gt; IOEnv env' a -&gt; IOEnv env a
</span><a href="GHC.Data.IOEnv.html#updEnv"><span class="hs-identifier hs-var">updEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681211399"><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211399"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211399"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">bkp_level :: Int
</span><a href="GHC.Driver.Backpack.html#bkp_level"><span class="hs-identifier hs-var">bkp_level</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BkpEnv -&gt; Int
</span><a href="GHC.Driver.Backpack.html#bkp_level"><span class="hs-identifier hs-var hs-var">bkp_level</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211399"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211401"><span class="hs-identifier hs-var">do_this</span></a></span><span>
</span><span id="line-463"></span><span>
</span><span id="line-464"></span><span class="hs-comment">-- | Update the EPS from a 'GhcMonad'. TODO move to appropriate library spot.</span><span>
</span><span id="line-465"></span><span id="local-6989586621681212148"><span class="annot"><a href="GHC.Driver.Backpack.html#updateEpsGhc_"><span class="hs-identifier hs-type">updateEpsGhc_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212148"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#ExternalPackageState"><span class="hs-identifier hs-type">ExternalPackageState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ExternalPackageState"><span class="hs-identifier hs-type">ExternalPackageState</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681212148"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-466"></span><span id="updateEpsGhc_"><span class="annot"><span class="annottext">updateEpsGhc_ :: forall (m :: * -&gt; *).
GhcMonad m =&gt;
(ExternalPackageState -&gt; ExternalPackageState) -&gt; m ()
</span><a href="GHC.Driver.Backpack.html#updateEpsGhc_"><span class="hs-identifier hs-var hs-var">updateEpsGhc_</span></a></span></span><span> </span><span id="local-6989586621681211387"><span class="annot"><span class="annottext">ExternalPackageState -&gt; ExternalPackageState
</span><a href="#local-6989586621681211387"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-467"></span><span>    </span><span id="local-6989586621681211386"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211386"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-468"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; m ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; m ()) -&gt; IO () -&gt; m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IORef ExternalPackageState
-&gt; (ExternalPackageState -&gt; (ExternalPackageState, ())) -&gt; IO ()
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef ExternalPackageState
</span><a href="GHC.Driver.Types.html#hsc_EPS"><span class="hs-identifier hs-var hs-var">hsc_EPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211386"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681211383"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681211383"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState -&gt; ExternalPackageState
</span><a href="#local-6989586621681211387"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681211383"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- | Get the EPS from a 'GhcMonad'.</span><span>
</span><span id="line-471"></span><span id="local-6989586621681212185"><span class="annot"><a href="GHC.Driver.Backpack.html#getEpsGhc"><span class="hs-identifier hs-type">getEpsGhc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#GhcMonad"><span class="hs-identifier hs-type">GhcMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212185"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681212185"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ExternalPackageState"><span class="hs-identifier hs-type">ExternalPackageState</span></a></span></span><span>
</span><span id="line-472"></span><span id="getEpsGhc"><span class="annot"><span class="annottext">getEpsGhc :: forall (m :: * -&gt; *). GhcMonad m =&gt; m ExternalPackageState
</span><a href="GHC.Driver.Backpack.html#getEpsGhc"><span class="hs-identifier hs-var hs-var">getEpsGhc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-473"></span><span>    </span><span id="local-6989586621681211373"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211373"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-474"></span><span>    </span><span class="annot"><span class="annottext">IO ExternalPackageState -&gt; m ExternalPackageState
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ExternalPackageState -&gt; m ExternalPackageState)
-&gt; IO ExternalPackageState -&gt; m ExternalPackageState
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IORef ExternalPackageState -&gt; IO ExternalPackageState
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef ExternalPackageState
</span><a href="GHC.Driver.Types.html#hsc_EPS"><span class="hs-identifier hs-var hs-var">hsc_EPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211373"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-475"></span><span>
</span><span id="line-476"></span><span class="hs-comment">-- | Run 'BkpM' in 'Ghc'.</span><span>
</span><span id="line-477"></span><span id="local-6989586621681212274"><span class="annot"><a href="GHC.Driver.Backpack.html#initBkpM"><span class="hs-identifier hs-type">initBkpM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212274"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Monad.html#Ghc"><span class="hs-identifier hs-type">Ghc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681212274"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-478"></span><span id="initBkpM"><span class="annot"><span class="annottext">initBkpM :: forall a. FilePath -&gt; [LHsUnit HsComponentId] -&gt; BkpM a -&gt; Ghc a
</span><a href="GHC.Driver.Backpack.html#initBkpM"><span class="hs-identifier hs-var hs-var">initBkpM</span></a></span></span><span> </span><span id="local-6989586621681211371"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211371"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span id="local-6989586621681211370"><span class="annot"><span class="annottext">[LHsUnit HsComponentId]
</span><a href="#local-6989586621681211370"><span class="hs-identifier hs-var">bkp</span></a></span></span><span> </span><span id="local-6989586621681211369"><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211369"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-479"></span><span>    </span><span class="annot"><span class="annottext">(Session -&gt; IO a) -&gt; Ghc a
forall a. (Session -&gt; IO a) -&gt; Ghc a
</span><a href="GHC.Driver.Monad.html#reifyGhc"><span class="hs-identifier hs-var">reifyGhc</span></a></span><span> </span><span class="annot"><span class="annottext">((Session -&gt; IO a) -&gt; Ghc a) -&gt; (Session -&gt; IO a) -&gt; Ghc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681211367"><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681211367"><span class="hs-identifier hs-var">session</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-480"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211364"><span class="annot"><span class="annottext">env :: BkpEnv
</span><a href="#local-6989586621681211364"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">BkpEnv :: Session
-&gt; FilePath
-&gt; Map IndefUnitId (LHsUnit HsComponentId)
-&gt; Int
-&gt; BkpEnv
</span><a href="GHC.Driver.Backpack.html#BkpEnv"><span class="hs-identifier hs-type">BkpEnv</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-481"></span><span>                    </span><span class="annot"><span class="annottext">bkp_session :: Session
</span><a href="GHC.Driver.Backpack.html#bkp_session"><span class="hs-identifier hs-var">bkp_session</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Session
</span><a href="#local-6989586621681211367"><span class="hs-identifier hs-var">session</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-482"></span><span>                    </span><span class="annot"><span class="annottext">bkp_table :: Map IndefUnitId (LHsUnit HsComponentId)
</span><a href="GHC.Driver.Backpack.html#bkp_table"><span class="hs-identifier hs-var">bkp_table</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(IndefUnitId, LHsUnit HsComponentId)]
-&gt; Map IndefUnitId (LHsUnit HsComponentId)
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsComponentId -&gt; IndefUnitId
</span><a href="GHC.Driver.Backpack.Syntax.html#hsComponentId"><span class="hs-identifier hs-var hs-var">hsComponentId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan HsComponentId -&gt; HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId -&gt; GenLocated SrcSpan HsComponentId
forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var hs-var">hsunitName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsUnit HsComponentId -&gt; HsUnit HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211362"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211362"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681211362"><span class="annot"><span class="annottext">LHsUnit HsComponentId
</span><a href="#local-6989586621681211362"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LHsUnit HsComponentId]
</span><a href="#local-6989586621681211370"><span class="hs-identifier hs-var">bkp</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-483"></span><span>                    </span><span class="annot"><span class="annottext">bkp_filename :: FilePath
</span><a href="GHC.Driver.Backpack.html#bkp_filename"><span class="hs-identifier hs-var">bkp_filename</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211371"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-484"></span><span>                    </span><span class="annot"><span class="annottext">bkp_level :: Int
</span><a href="GHC.Driver.Backpack.html#bkp_level"><span class="hs-identifier hs-var">bkp_level</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-485"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-486"></span><span>    </span><span class="annot"><span class="annottext">BkpEnv -&gt; BkpM a -&gt; IO a
forall env a. env -&gt; IOEnv env a -&gt; IO a
</span><a href="GHC.Data.IOEnv.html#runIOEnv"><span class="hs-identifier hs-var">runIOEnv</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211364"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">BkpM a
</span><a href="#local-6989586621681211369"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-489"></span><span class="hs-comment">-- Messaging</span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="hs-comment">-- | Print a compilation progress message, but with indentation according</span><span>
</span><span id="line-492"></span><span class="hs-comment">-- to @level@ (for nested compilation).</span><span>
</span><span id="line-493"></span><span class="annot"><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-type">backpackProgressMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span id="backpackProgressMsg"><span class="annot"><span class="annottext">backpackProgressMsg :: Int -&gt; DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-var hs-var">backpackProgressMsg</span></a></span></span><span> </span><span id="local-6989586621681211359"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211359"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span id="local-6989586621681211358"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211358"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681211357"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211357"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-495"></span><span>    </span><span class="annot"><span class="annottext">DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Utils.Error.html#compilationProgressMsg"><span class="hs-identifier hs-var">compilationProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211358"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; FilePath
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211359"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211357"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span class="hs-comment">-- | Creates a 'Messager' for Backpack compilation; this is basically</span><span>
</span><span id="line-498"></span><span class="hs-comment">-- a carbon copy of 'batchMsg' but calling 'backpackProgressMsg', which</span><span>
</span><span id="line-499"></span><span class="hs-comment">-- handles indentation.</span><span>
</span><span id="line-500"></span><span class="annot"><a href="GHC.Driver.Backpack.html#mkBackpackMsg"><span class="hs-identifier hs-type">mkBackpackMsg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Main.html#Messager"><span class="hs-identifier hs-type">Messager</span></a></span><span>
</span><span id="line-501"></span><span id="mkBackpackMsg"><span class="annot"><span class="annottext">mkBackpackMsg :: BkpM Messager
</span><a href="GHC.Driver.Backpack.html#mkBackpackMsg"><span class="hs-identifier hs-var hs-var">mkBackpackMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-502"></span><span>    </span><span id="local-6989586621681211353"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211353"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Int
</span><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-var">getBkpLevel</span></a></span><span>
</span><span id="line-503"></span><span>    </span><span class="annot"><span class="annottext">Messager -&gt; BkpM Messager
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Messager -&gt; BkpM Messager) -&gt; Messager -&gt; BkpM Messager
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681211352"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211352"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681211351"><span class="annot"><span class="annottext">(Int, Int)
</span><a href="#local-6989586621681211351"><span class="hs-identifier hs-var">mod_index</span></a></span></span><span> </span><span id="local-6989586621681211350"><span class="annot"><span class="annottext">RecompileRequired
</span><a href="#local-6989586621681211350"><span class="hs-identifier hs-var">recomp</span></a></span></span><span> </span><span id="local-6989586621681211349"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211349"><span class="hs-identifier hs-var">mod_summary</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-504"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211348"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681211348"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211352"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-505"></span><span>          </span><span id="local-6989586621681211347"><span class="annot"><span class="annottext">showMsg :: FilePath -&gt; FilePath -&gt; IO ()
</span><a href="#local-6989586621681211347"><span class="hs-identifier hs-var hs-var">showMsg</span></a></span></span><span> </span><span id="local-6989586621681211346"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211346"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span id="local-6989586621681211345"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211345"><span class="hs-identifier hs-var">reason</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-506"></span><span>            </span><span class="annot"><span class="annottext">Int -&gt; DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-var">backpackProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211353"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211348"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; IO ()) -&gt; FilePath -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-507"></span><span>                </span><span class="annot"><span class="annottext">(Int, Int) -&gt; FilePath
</span><a href="GHC.Driver.Main.html#showModuleIndex"><span class="hs-identifier hs-var">showModuleIndex</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, Int)
</span><a href="#local-6989586621681211351"><span class="hs-identifier hs-var">mod_index</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-508"></span><span>                </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211346"><span class="hs-identifier hs-var">msg</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget -&gt; Bool -&gt; ModSummary -&gt; FilePath
</span><a href="GHC.Driver.Types.html#showModMsg"><span class="hs-identifier hs-var">showModMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211348"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; HscTarget
</span><a href="GHC.Driver.Session.html#hscTarget"><span class="hs-identifier hs-var hs-var">hscTarget</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211348"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-509"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecompileRequired -&gt; Bool
</span><a href="GHC.Iface.Recomp.html#recompileRequired"><span class="hs-identifier hs-var">recompileRequired</span></a></span><span> </span><span class="annot"><span class="annottext">RecompileRequired
</span><a href="#local-6989586621681211350"><span class="hs-identifier hs-var">recomp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211349"><span class="hs-identifier hs-var">mod_summary</span></a></span><span>
</span><span id="line-510"></span><span>                    </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211345"><span class="hs-identifier hs-var">reason</span></a></span><span>
</span><span id="line-511"></span><span>      </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RecompileRequired
</span><a href="#local-6989586621681211350"><span class="hs-identifier hs-var">recomp</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-512"></span><span>            </span><span class="annot"><span class="annottext">RecompileRequired
</span><a href="GHC.Iface.Recomp.html#MustCompile"><span class="hs-identifier hs-var">MustCompile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; IO ()
</span><a href="#local-6989586621681211347"><span class="hs-identifier hs-var">showMsg</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Compiling &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-513"></span><span>            </span><span class="annot"><span class="annottext">RecompileRequired
</span><a href="GHC.Iface.Recomp.html#UpToDate"><span class="hs-identifier hs-var">UpToDate</span></a></span><span>
</span><span id="line-514"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211352"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; IO ()
</span><a href="#local-6989586621681211347"><span class="hs-identifier hs-var">showMsg</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Skipping  &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-515"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-516"></span><span>            </span><span class="annot"><a href="GHC.Iface.Recomp.html#RecompBecause"><span class="hs-identifier hs-type">RecompBecause</span></a></span><span> </span><span id="local-6989586621681211337"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211337"><span class="hs-identifier hs-var">reason</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; IO ()
</span><a href="#local-6989586621681211347"><span class="hs-identifier hs-var">showMsg</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Compiling &quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot; [&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211337"><span class="hs-identifier hs-var">reason</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;]&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-517"></span><span>
</span><span id="line-518"></span><span class="hs-comment">-- | 'PprStyle' for Backpack messages; here we usually want the module to</span><span>
</span><span id="line-519"></span><span class="hs-comment">-- be qualified (so we can tell how it was instantiated.) But we try not</span><span>
</span><span id="line-520"></span><span class="hs-comment">-- to qualify packages so we can use simple names for them.</span><span>
</span><span id="line-521"></span><span class="annot"><a href="GHC.Driver.Backpack.html#backpackStyle"><span class="hs-identifier hs-type">backpackStyle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PprStyle"><span class="hs-identifier hs-type">PprStyle</span></a></span><span>
</span><span id="line-522"></span><span id="backpackStyle"><span class="annot"><span class="annottext">backpackStyle :: PprStyle
</span><a href="GHC.Driver.Backpack.html#backpackStyle"><span class="hs-identifier hs-var hs-var">backpackStyle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-523"></span><span>    </span><span class="annot"><span class="annottext">PrintUnqualified -&gt; Depth -&gt; PprStyle
</span><a href="GHC.Utils.Outputable.html#mkUserStyle"><span class="hs-identifier hs-var">mkUserStyle</span></a></span><span>
</span><span id="line-524"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">QueryQualifyName
-&gt; (Module -&gt; Bool) -&gt; QueryQualifyPackage -&gt; PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#QueryQualify"><span class="hs-identifier hs-var">QueryQualify</span></a></span><span> </span><span class="annot"><span class="annottext">QueryQualifyName
</span><a href="GHC.Utils.Outputable.html#neverQualifyNames"><span class="hs-identifier hs-var">neverQualifyNames</span></a></span><span>
</span><span id="line-525"></span><span>                      </span><span class="annot"><span class="annottext">Module -&gt; Bool
</span><a href="GHC.Utils.Outputable.html#alwaysQualifyModules"><span class="hs-identifier hs-var">alwaysQualifyModules</span></a></span><span>
</span><span id="line-526"></span><span>                      </span><span class="annot"><span class="annottext">QueryQualifyPackage
</span><a href="GHC.Utils.Outputable.html#neverQualifyPackages"><span class="hs-identifier hs-var">neverQualifyPackages</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Depth
</span><a href="GHC.Utils.Outputable.html#AllTheWay"><span class="hs-identifier hs-var">AllTheWay</span></a></span><span>
</span><span id="line-527"></span><span>
</span><span id="line-528"></span><span class="hs-comment">-- | Message when we initially process a Backpack unit.</span><span>
</span><span id="line-529"></span><span class="annot"><a href="GHC.Driver.Backpack.html#msgTopPackage"><span class="hs-identifier hs-type">msgTopPackage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-530"></span><span id="msgTopPackage"><span class="annot"><span class="annottext">msgTopPackage :: (Int, Int) -&gt; HsComponentId -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgTopPackage"><span class="hs-identifier hs-var hs-var">msgTopPackage</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211329"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211329"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681211328"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211328"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span id="local-6989586621681211326"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211326"><span class="hs-identifier hs-var">fs_pn</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-531"></span><span>    </span><span id="local-6989586621681211325"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211325"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-532"></span><span>    </span><span id="local-6989586621681211324"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211324"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Int
</span><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-var">getBkpLevel</span></a></span><span>
</span><span id="line-533"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; BkpM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; BkpM ()) -&gt; (FilePath -&gt; IO ()) -&gt; FilePath -&gt; BkpM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-var">backpackProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211324"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211325"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-534"></span><span>        </span><span class="annot"><span class="annottext">(FilePath -&gt; BkpM ()) -&gt; FilePath -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, Int) -&gt; FilePath
</span><a href="GHC.Driver.Main.html#showModuleIndex"><span class="hs-identifier hs-var">showModuleIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211329"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211328"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Processing &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211326"><span class="hs-identifier hs-var">fs_pn</span></a></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span class="hs-comment">-- | Message when we instantiate a Backpack unit.</span><span>
</span><span id="line-537"></span><span class="annot"><a href="GHC.Driver.Backpack.html#msgUnitId"><span class="hs-identifier hs-type">msgUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-538"></span><span id="msgUnitId"><span class="annot"><span class="annottext">msgUnitId :: Unit -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgUnitId"><span class="hs-identifier hs-var hs-var">msgUnitId</span></a></span></span><span> </span><span id="local-6989586621681211323"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211323"><span class="hs-identifier hs-var">pk</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-539"></span><span>    </span><span id="local-6989586621681211322"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211322"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-540"></span><span>    </span><span id="local-6989586621681211321"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211321"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Int
</span><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-var">getBkpLevel</span></a></span><span>
</span><span id="line-541"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; BkpM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; BkpM ()) -&gt; (FilePath -&gt; IO ()) -&gt; FilePath -&gt; BkpM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-var">backpackProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211321"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211322"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-542"></span><span>        </span><span class="annot"><span class="annottext">(FilePath -&gt; BkpM ()) -&gt; FilePath -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Instantiating &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">SDocContext -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#renderWithStyle"><span class="hs-identifier hs-var">renderWithStyle</span></a></span><span>
</span><span id="line-543"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; PprStyle -&gt; SDocContext
</span><a href="GHC.Driver.Session.html#initSDocContext"><span class="hs-identifier hs-var">initSDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211322"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Driver.Backpack.html#backpackStyle"><span class="hs-identifier hs-var">backpackStyle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-544"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211323"><span class="hs-identifier hs-var">pk</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- | Message when we include a Backpack unit.</span><span>
</span><span id="line-547"></span><span class="annot"><a href="GHC.Driver.Backpack.html#msgInclude"><span class="hs-identifier hs-type">msgInclude</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-548"></span><span id="msgInclude"><span class="annot"><span class="annottext">msgInclude :: (Int, Int) -&gt; Unit -&gt; BkpM ()
</span><a href="GHC.Driver.Backpack.html#msgInclude"><span class="hs-identifier hs-var hs-var">msgInclude</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211318"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211318"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681211317"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211317"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681211316"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211316"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-549"></span><span>    </span><span id="local-6989586621681211315"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211315"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-550"></span><span>    </span><span id="local-6989586621681211314"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211314"><span class="hs-identifier hs-var">level</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM Int
</span><a href="GHC.Driver.Backpack.html#getBkpLevel"><span class="hs-identifier hs-var">getBkpLevel</span></a></span><span>
</span><span id="line-551"></span><span>    </span><span class="annot"><span class="annottext">IO () -&gt; BkpM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; BkpM ()) -&gt; (FilePath -&gt; IO ()) -&gt; FilePath -&gt; BkpM ()
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; DynFlags -&gt; FilePath -&gt; IO ()
</span><a href="GHC.Driver.Backpack.html#backpackProgressMsg"><span class="hs-identifier hs-var">backpackProgressMsg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211314"><span class="hs-identifier hs-var">level</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211315"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-552"></span><span>        </span><span class="annot"><span class="annottext">(FilePath -&gt; BkpM ()) -&gt; FilePath -&gt; BkpM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Int, Int) -&gt; FilePath
</span><a href="GHC.Driver.Main.html#showModuleIndex"><span class="hs-identifier hs-var">showModuleIndex</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211318"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681211317"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;Including &quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-553"></span><span>          </span><span class="annot"><span class="annottext">SDocContext -&gt; SDoc -&gt; FilePath
</span><a href="GHC.Utils.Outputable.html#renderWithStyle"><span class="hs-identifier hs-var">renderWithStyle</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; PprStyle -&gt; SDocContext
</span><a href="GHC.Driver.Session.html#initSDocContext"><span class="hs-identifier hs-var">initSDocContext</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211315"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Driver.Backpack.html#backpackStyle"><span class="hs-identifier hs-var">backpackStyle</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-554"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621681211316"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-555"></span><span>
</span><span id="line-556"></span><span class="hs-comment">-- ----------------------------------------------------------------------------</span><span>
</span><span id="line-557"></span><span class="hs-comment">-- Conversion from PackageName to HsComponentId</span><span>
</span><span id="line-558"></span><span>
</span><span id="line-559"></span><span class="hs-keyword">type</span><span> </span><span id="PackageNameMap"><span class="annot"><a href="GHC.Driver.Backpack.html#PackageNameMap"><span class="hs-identifier hs-var">PackageNameMap</span></a></span></span><span> </span><span id="local-6989586621681211313"><span class="annot"><a href="#local-6989586621681211313"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681211313"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="hs-comment">-- For now, something really simple, since we're not actually going</span><span>
</span><span id="line-562"></span><span class="hs-comment">-- to use this for anything</span><span>
</span><span id="line-563"></span><span class="annot"><a href="GHC.Driver.Backpack.html#unitDefines"><span class="hs-identifier hs-type">unitDefines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#UnitState"><span class="hs-identifier hs-type">UnitState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-564"></span><span id="unitDefines"><span class="annot"><span class="annottext">unitDefines :: UnitState -&gt; LHsUnit PackageName -&gt; (PackageName, HsComponentId)
</span><a href="GHC.Driver.Backpack.html#unitDefines"><span class="hs-identifier hs-var hs-var">unitDefines</span></a></span></span><span> </span><span id="local-6989586621681211311"><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211311"><span class="hs-identifier hs-var">pkgstate</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hsunitName :: forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var">hsunitName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211309"><span class="annot"><span class="annottext">pn :: PackageName
</span><a href="#local-6989586621681211309"><span class="hs-identifier hs-var">pn</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span id="local-6989586621681211308"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211308"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-565"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211309"><span class="hs-identifier hs-var">pn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; IndefUnitId -&gt; HsComponentId
</span><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-var">HsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211309"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; FastString -&gt; IndefUnitId
</span><a href="GHC.Unit.State.html#mkIndefUnitId"><span class="hs-identifier hs-var">mkIndefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211311"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211308"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span class="annot"><a href="GHC.Driver.Backpack.html#bkpPackageNameMap"><span class="hs-identifier hs-type">bkpPackageNameMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#UnitState"><span class="hs-identifier hs-type">UnitState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#PackageNameMap"><span class="hs-identifier hs-type">PackageNameMap</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-568"></span><span id="bkpPackageNameMap"><span class="annot"><span class="annottext">bkpPackageNameMap :: UnitState -&gt; [LHsUnit PackageName] -&gt; PackageNameMap HsComponentId
</span><a href="GHC.Driver.Backpack.html#bkpPackageNameMap"><span class="hs-identifier hs-var hs-var">bkpPackageNameMap</span></a></span></span><span> </span><span id="local-6989586621681211306"><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211306"><span class="hs-identifier hs-var">pkgstate</span></a></span></span><span> </span><span id="local-6989586621681211305"><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211305"><span class="hs-identifier hs-var">units</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(PackageName, HsComponentId)] -&gt; PackageNameMap HsComponentId
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsUnit PackageName -&gt; (PackageName, HsComponentId))
-&gt; [LHsUnit PackageName] -&gt; [(PackageName, HsComponentId)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; LHsUnit PackageName -&gt; (PackageName, HsComponentId)
</span><a href="GHC.Driver.Backpack.html#unitDefines"><span class="hs-identifier hs-var">unitDefines</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211306"><span class="hs-identifier hs-var">pkgstate</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211305"><span class="hs-identifier hs-var">units</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span class="annot"><a href="GHC.Driver.Backpack.html#renameHsUnits"><span class="hs-identifier hs-type">renameHsUnits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#UnitState"><span class="hs-identifier hs-type">UnitState</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#PackageNameMap"><span class="hs-identifier hs-type">PackageNameMap</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#LHsUnit"><span class="hs-identifier hs-type">LHsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-571"></span><span id="renameHsUnits"><span class="annot"><span class="annottext">renameHsUnits :: UnitState
-&gt; PackageNameMap HsComponentId
-&gt; [LHsUnit PackageName]
-&gt; [LHsUnit HsComponentId]
</span><a href="GHC.Driver.Backpack.html#renameHsUnits"><span class="hs-identifier hs-var hs-var">renameHsUnits</span></a></span></span><span> </span><span id="local-6989586621681211304"><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211304"><span class="hs-identifier hs-var">pkgstate</span></a></span></span><span> </span><span id="local-6989586621681211303"><span class="annot"><span class="annottext">PackageNameMap HsComponentId
</span><a href="#local-6989586621681211303"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621681211302"><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211302"><span class="hs-identifier hs-var">units</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LHsUnit PackageName -&gt; LHsUnit HsComponentId)
-&gt; [LHsUnit PackageName] -&gt; [LHsUnit HsComponentId]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsUnit PackageName -&gt; HsUnit HsComponentId)
-&gt; LHsUnit PackageName -&gt; LHsUnit HsComponentId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit PackageName -&gt; HsUnit HsComponentId
</span><a href="#local-6989586621681211301"><span class="hs-identifier hs-var">renameHsUnit</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsUnit PackageName]
</span><a href="#local-6989586621681211302"><span class="hs-identifier hs-var">units</span></a></span><span>
</span><span id="line-572"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-573"></span><span>
</span><span id="line-574"></span><span>    </span><span class="annot"><a href="#local-6989586621681211300"><span class="hs-identifier hs-type">renamePackageName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-575"></span><span>    </span><span id="local-6989586621681211300"><span class="annot"><span class="annottext">renamePackageName :: PackageName -&gt; HsComponentId
</span><a href="#local-6989586621681211300"><span class="hs-identifier hs-var hs-var">renamePackageName</span></a></span></span><span> </span><span id="local-6989586621681211299"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211299"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-576"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; PackageNameMap HsComponentId -&gt; Maybe HsComponentId
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211299"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">PackageNameMap HsComponentId
</span><a href="#local-6989586621681211303"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-577"></span><span>            </span><span class="annot"><span class="annottext">Maybe HsComponentId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-578"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; PackageName -&gt; Maybe IndefUnitId
</span><a href="GHC.Unit.State.html#lookupPackageName"><span class="hs-identifier hs-var">lookupPackageName</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621681211304"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211299"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-579"></span><span>                    </span><span class="annot"><span class="annottext">Maybe IndefUnitId
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; HsComponentId
forall a. HasCallStack =&gt; FilePath -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;no package name&quot;</span></span><span>
</span><span id="line-580"></span><span>                    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211296"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211296"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; IndefUnitId -&gt; HsComponentId
</span><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-var">HsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211299"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211296"><span class="hs-identifier hs-var">cid</span></a></span><span>
</span><span id="line-581"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211295"><span class="annot"><span class="annottext">HsComponentId
</span><a href="#local-6989586621681211295"><span class="hs-identifier hs-var">hscid</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsComponentId
</span><a href="#local-6989586621681211295"><span class="hs-identifier hs-var">hscid</span></a></span><span>
</span><span id="line-582"></span><span>
</span><span id="line-583"></span><span>    </span><span class="annot"><a href="#local-6989586621681211301"><span class="hs-identifier hs-type">renameHsUnit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-584"></span><span>    </span><span id="local-6989586621681211301"><span class="annot"><span class="annottext">renameHsUnit :: HsUnit PackageName -&gt; HsUnit HsComponentId
</span><a href="#local-6989586621681211301"><span class="hs-identifier hs-var hs-var">renameHsUnit</span></a></span></span><span> </span><span id="local-6989586621681211294"><span class="annot"><span class="annottext">HsUnit PackageName
</span><a href="#local-6989586621681211294"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-585"></span><span>        </span><span class="annot"><span class="annottext">HsUnit :: forall n. Located n -&gt; [LHsUnitDecl n] -&gt; HsUnit n
</span><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-586"></span><span>            </span><span class="annot"><span class="annottext">hsunitName :: GenLocated SrcSpan HsComponentId
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var">hsunitName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PackageName -&gt; HsComponentId)
-&gt; GenLocated SrcSpan PackageName
-&gt; GenLocated SrcSpan HsComponentId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; HsComponentId
</span><a href="#local-6989586621681211300"><span class="hs-identifier hs-var">renamePackageName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit PackageName -&gt; GenLocated SrcSpan PackageName
forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var hs-var">hsunitName</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit PackageName
</span><a href="#local-6989586621681211294"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-587"></span><span>            </span><span class="annot"><span class="annottext">hsunitBody :: [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitBody"><span class="hs-identifier hs-var">hsunitBody</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsUnitDecl PackageName)
 -&gt; GenLocated SrcSpan (HsUnitDecl HsComponentId))
-&gt; [GenLocated SrcSpan (HsUnitDecl PackageName)]
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsUnitDecl PackageName -&gt; HsUnitDecl HsComponentId)
-&gt; GenLocated SrcSpan (HsUnitDecl PackageName)
-&gt; GenLocated SrcSpan (HsUnitDecl HsComponentId)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitDecl PackageName -&gt; HsUnitDecl HsComponentId
</span><a href="#local-6989586621681211293"><span class="hs-identifier hs-var">renameHsUnitDecl</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit PackageName -&gt; [GenLocated SrcSpan (HsUnitDecl PackageName)]
forall n. HsUnit n -&gt; [LHsUnitDecl n]
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitBody"><span class="hs-identifier hs-var hs-var">hsunitBody</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit PackageName
</span><a href="#local-6989586621681211294"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-588"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-589"></span><span>
</span><span id="line-590"></span><span>    </span><span class="annot"><a href="#local-6989586621681211293"><span class="hs-identifier hs-type">renameHsUnitDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitDecl"><span class="hs-identifier hs-type">HsUnitDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitDecl"><span class="hs-identifier hs-type">HsUnitDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-591"></span><span>    </span><span id="local-6989586621681211293"><span class="annot"><span class="annottext">renameHsUnitDecl :: HsUnitDecl PackageName -&gt; HsUnitDecl HsComponentId
</span><a href="#local-6989586621681211293"><span class="hs-identifier hs-var hs-var">renameHsUnitDecl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-type">DeclD</span></a></span><span> </span><span id="local-6989586621681211292"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211292"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681211291"><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211291"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span id="local-6989586621681211290"><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><a href="#local-6989586621681211290"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscSource
-&gt; GenLocated SrcSpan ModuleName
-&gt; Maybe (Located HsModule)
-&gt; HsUnitDecl HsComponentId
forall n.
HscSource
-&gt; GenLocated SrcSpan ModuleName
-&gt; Maybe (Located HsModule)
-&gt; HsUnitDecl n
</span><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-var">DeclD</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211292"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211291"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><a href="#local-6989586621681211290"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-592"></span><span>    </span><span class="annot"><a href="#local-6989586621681211293"><span class="hs-identifier hs-var">renameHsUnitDecl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#IncludeD"><span class="hs-identifier hs-type">IncludeD</span></a></span><span> </span><span id="local-6989586621681211289"><span class="annot"><span class="annottext">IncludeDecl PackageName
</span><a href="#local-6989586621681211289"><span class="hs-identifier hs-var">idecl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-593"></span><span>        </span><span class="annot"><span class="annottext">IncludeDecl HsComponentId -&gt; HsUnitDecl HsComponentId
forall n. IncludeDecl n -&gt; HsUnitDecl n
</span><a href="GHC.Driver.Backpack.Syntax.html#IncludeD"><span class="hs-identifier hs-var">IncludeD</span></a></span><span> </span><span class="annot"><span class="annottext">IncludeDecl :: forall n. LHsUnitId n -&gt; Maybe [LRenaming] -&gt; Bool -&gt; IncludeDecl n
</span><a href="GHC.Driver.Backpack.Syntax.html#IncludeDecl"><span class="hs-identifier hs-type">IncludeDecl</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-594"></span><span>            </span><span class="annot"><span class="annottext">idUnitId :: GenLocated SrcSpan (HsUnitId HsComponentId)
</span><a href="GHC.Driver.Backpack.Syntax.html#idUnitId"><span class="hs-identifier hs-var">idUnitId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsUnitId PackageName -&gt; HsUnitId HsComponentId)
-&gt; GenLocated SrcSpan (HsUnitId PackageName)
-&gt; GenLocated SrcSpan (HsUnitId HsComponentId)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitId PackageName -&gt; HsUnitId HsComponentId
</span><a href="#local-6989586621681211287"><span class="hs-identifier hs-var">renameHsUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IncludeDecl PackageName
-&gt; GenLocated SrcSpan (HsUnitId PackageName)
forall n. IncludeDecl n -&gt; LHsUnitId n
</span><a href="GHC.Driver.Backpack.Syntax.html#idUnitId"><span class="hs-identifier hs-var hs-var">idUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">IncludeDecl PackageName
</span><a href="#local-6989586621681211289"><span class="hs-identifier hs-var">idecl</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-595"></span><span>            </span><span class="annot"><span class="annottext">idModRenaming :: Maybe [LRenaming]
</span><a href="GHC.Driver.Backpack.Syntax.html#idModRenaming"><span class="hs-identifier hs-var">idModRenaming</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IncludeDecl PackageName -&gt; Maybe [LRenaming]
forall n. IncludeDecl n -&gt; Maybe [LRenaming]
</span><a href="GHC.Driver.Backpack.Syntax.html#idModRenaming"><span class="hs-identifier hs-var hs-var">idModRenaming</span></a></span><span> </span><span class="annot"><span class="annottext">IncludeDecl PackageName
</span><a href="#local-6989586621681211289"><span class="hs-identifier hs-var">idecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-596"></span><span>            </span><span class="annot"><span class="annottext">idSignatureInclude :: Bool
</span><a href="GHC.Driver.Backpack.Syntax.html#idSignatureInclude"><span class="hs-identifier hs-var">idSignatureInclude</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IncludeDecl PackageName -&gt; Bool
forall n. IncludeDecl n -&gt; Bool
</span><a href="GHC.Driver.Backpack.Syntax.html#idSignatureInclude"><span class="hs-identifier hs-var hs-var">idSignatureInclude</span></a></span><span> </span><span class="annot"><span class="annottext">IncludeDecl PackageName
</span><a href="#local-6989586621681211289"><span class="hs-identifier hs-var">idecl</span></a></span><span>
</span><span id="line-597"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-598"></span><span>
</span><span id="line-599"></span><span>    </span><span class="annot"><a href="#local-6989586621681211287"><span class="hs-identifier hs-type">renameHsUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-type">HsUnitId</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-type">HsUnitId</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-600"></span><span>    </span><span id="local-6989586621681211287"><span class="annot"><span class="annottext">renameHsUnitId :: HsUnitId PackageName -&gt; HsUnitId HsComponentId
</span><a href="#local-6989586621681211287"><span class="hs-identifier hs-var hs-var">renameHsUnitId</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-type">HsUnitId</span></a></span><span> </span><span id="local-6989586621681211283"><span class="annot"><span class="annottext">GenLocated SrcSpan PackageName
</span><a href="#local-6989586621681211283"><span class="hs-identifier hs-var">ln</span></a></span></span><span> </span><span id="local-6989586621681211282"><span class="annot"><span class="annottext">[LHsModuleSubst PackageName]
</span><a href="#local-6989586621681211282"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-601"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan HsComponentId
-&gt; [LHsModuleSubst HsComponentId] -&gt; HsUnitId HsComponentId
forall n. Located n -&gt; [LHsModuleSubst n] -&gt; HsUnitId n
</span><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-var">HsUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(PackageName -&gt; HsComponentId)
-&gt; GenLocated SrcSpan PackageName
-&gt; GenLocated SrcSpan HsComponentId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; HsComponentId
</span><a href="#local-6989586621681211300"><span class="hs-identifier hs-var">renamePackageName</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan PackageName
</span><a href="#local-6989586621681211283"><span class="hs-identifier hs-var">ln</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsModuleSubst PackageName -&gt; LHsModuleSubst HsComponentId)
-&gt; [LHsModuleSubst PackageName] -&gt; [LHsModuleSubst HsComponentId]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsModuleSubst PackageName -&gt; HsModuleSubst HsComponentId)
-&gt; LHsModuleSubst PackageName -&gt; LHsModuleSubst HsComponentId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsModuleSubst PackageName -&gt; HsModuleSubst HsComponentId
</span><a href="#local-6989586621681211281"><span class="hs-identifier hs-var">renameHsModuleSubst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsModuleSubst PackageName]
</span><a href="#local-6989586621681211282"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span>    </span><span class="annot"><a href="#local-6989586621681211281"><span class="hs-identifier hs-type">renameHsModuleSubst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleSubst"><span class="hs-identifier hs-type">HsModuleSubst</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleSubst"><span class="hs-identifier hs-type">HsModuleSubst</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-604"></span><span>    </span><span id="local-6989586621681211281"><span class="annot"><span class="annottext">renameHsModuleSubst :: HsModuleSubst PackageName -&gt; HsModuleSubst HsComponentId
</span><a href="#local-6989586621681211281"><span class="hs-identifier hs-var hs-var">renameHsModuleSubst</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211280"><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211280"><span class="hs-identifier hs-var">lk</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211279"><span class="annot"><span class="annottext">LHsModuleId PackageName
</span><a href="#local-6989586621681211279"><span class="hs-identifier hs-var">lm</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211280"><span class="hs-identifier hs-var">lk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(HsModuleId PackageName -&gt; HsModuleId HsComponentId)
-&gt; LHsModuleId PackageName
-&gt; GenLocated SrcSpan (HsModuleId HsComponentId)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsModuleId PackageName -&gt; HsModuleId HsComponentId
</span><a href="#local-6989586621681211278"><span class="hs-identifier hs-var">renameHsModuleId</span></a></span><span> </span><span class="annot"><span class="annottext">LHsModuleId PackageName
</span><a href="#local-6989586621681211279"><span class="hs-identifier hs-var">lm</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-606"></span><span>
</span><span id="line-607"></span><span>    </span><span class="annot"><a href="#local-6989586621681211278"><span class="hs-identifier hs-type">renameHsModuleId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-type">HsModuleId</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-type">HsModuleId</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span>
</span><span id="line-608"></span><span>    </span><span id="local-6989586621681211278"><span class="annot"><span class="annottext">renameHsModuleId :: HsModuleId PackageName -&gt; HsModuleId HsComponentId
</span><a href="#local-6989586621681211278"><span class="hs-identifier hs-var hs-var">renameHsModuleId</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleVar"><span class="hs-identifier hs-type">HsModuleVar</span></a></span><span> </span><span id="local-6989586621681211276"><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211276"><span class="hs-identifier hs-var">lm</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName -&gt; HsModuleId HsComponentId
forall n. GenLocated SrcSpan ModuleName -&gt; HsModuleId n
</span><a href="GHC.Driver.Backpack.Syntax.html#HsModuleVar"><span class="hs-identifier hs-var">HsModuleVar</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211276"><span class="hs-identifier hs-var">lm</span></a></span><span>
</span><span id="line-609"></span><span>    </span><span class="annot"><a href="#local-6989586621681211278"><span class="hs-identifier hs-var">renameHsModuleId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-type">HsModuleId</span></a></span><span> </span><span id="local-6989586621681211274"><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitId PackageName)
</span><a href="#local-6989586621681211274"><span class="hs-identifier hs-var">luid</span></a></span></span><span> </span><span id="local-6989586621681211273"><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211273"><span class="hs-identifier hs-var">lm</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitId HsComponentId)
-&gt; GenLocated SrcSpan ModuleName -&gt; HsModuleId HsComponentId
forall n.
LHsUnitId n -&gt; GenLocated SrcSpan ModuleName -&gt; HsModuleId n
</span><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-var">HsModuleId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsUnitId PackageName -&gt; HsUnitId HsComponentId)
-&gt; GenLocated SrcSpan (HsUnitId PackageName)
-&gt; GenLocated SrcSpan (HsUnitId HsComponentId)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitId PackageName -&gt; HsUnitId HsComponentId
</span><a href="#local-6989586621681211287"><span class="hs-identifier hs-var">renameHsUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitId PackageName)
</span><a href="#local-6989586621681211274"><span class="hs-identifier hs-var">luid</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211273"><span class="hs-identifier hs-var">lm</span></a></span><span>
</span><span id="line-610"></span><span>
</span><span id="line-611"></span><span class="annot"><a href="GHC.Driver.Backpack.html#convertHsComponentId"><span class="hs-identifier hs-type">convertHsComponentId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-type">HsUnitId</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span>
</span><span id="line-612"></span><span id="convertHsComponentId"><span class="annot"><span class="annottext">convertHsComponentId :: HsUnitId HsComponentId -&gt; Unit
</span><a href="GHC.Driver.Backpack.html#convertHsComponentId"><span class="hs-identifier hs-var hs-var">convertHsComponentId</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnitId"><span class="hs-identifier hs-type">HsUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211272"><span class="annot"><span class="annottext">HsComponentId
</span><a href="#local-6989586621681211272"><span class="hs-identifier hs-var">hscid</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681211271"><span class="annot"><span class="annottext">[LHsModuleSubst HsComponentId]
</span><a href="#local-6989586621681211271"><span class="hs-identifier hs-var">subst</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-613"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; [(ModuleName, Module)] -&gt; Unit
</span><a href="GHC.Unit.Types.html#mkVirtUnit"><span class="hs-identifier hs-var">mkVirtUnit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsComponentId -&gt; IndefUnitId
</span><a href="GHC.Driver.Backpack.Syntax.html#hsComponentId"><span class="hs-identifier hs-var hs-var">hsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">HsComponentId
</span><a href="#local-6989586621681211272"><span class="hs-identifier hs-var">hscid</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsModuleSubst HsComponentId -&gt; (ModuleName, Module))
-&gt; [LHsModuleSubst HsComponentId] -&gt; [(ModuleName, Module)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsModuleSubst HsComponentId -&gt; (ModuleName, Module)
</span><a href="GHC.Driver.Backpack.html#convertHsModuleSubst"><span class="hs-identifier hs-var">convertHsModuleSubst</span></a></span><span> </span><span class="annot"><span class="annottext">(HsModuleSubst HsComponentId -&gt; (ModuleName, Module))
-&gt; (LHsModuleSubst HsComponentId -&gt; HsModuleSubst HsComponentId)
-&gt; LHsModuleSubst HsComponentId
-&gt; (ModuleName, Module)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LHsModuleSubst HsComponentId -&gt; HsModuleSubst HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsModuleSubst HsComponentId]
</span><a href="#local-6989586621681211271"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span class="annot"><a href="GHC.Driver.Backpack.html#convertHsModuleSubst"><span class="hs-identifier hs-type">convertHsModuleSubst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleSubst"><span class="hs-identifier hs-type">HsModuleSubst</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span id="convertHsModuleSubst"><span class="annot"><span class="annottext">convertHsModuleSubst :: HsModuleSubst HsComponentId -&gt; (ModuleName, Module)
</span><a href="GHC.Driver.Backpack.html#convertHsModuleSubst"><span class="hs-identifier hs-var hs-var">convertHsModuleSubst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211269"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211269"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211268"><span class="annot"><span class="annottext">HsModuleId HsComponentId
</span><a href="#local-6989586621681211268"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211269"><span class="hs-identifier hs-var">modname</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsModuleId HsComponentId -&gt; Module
</span><a href="GHC.Driver.Backpack.html#convertHsModuleId"><span class="hs-identifier hs-var">convertHsModuleId</span></a></span><span> </span><span class="annot"><span class="annottext">HsModuleId HsComponentId
</span><a href="#local-6989586621681211268"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="annot"><a href="GHC.Driver.Backpack.html#convertHsModuleId"><span class="hs-identifier hs-type">convertHsModuleId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-type">HsModuleId</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-619"></span><span id="convertHsModuleId"><span class="annot"><span class="annottext">convertHsModuleId :: HsModuleId HsComponentId -&gt; Module
</span><a href="GHC.Driver.Backpack.html#convertHsModuleId"><span class="hs-identifier hs-var hs-var">convertHsModuleId</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleVar"><span class="hs-identifier hs-type">HsModuleVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211266"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211266"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Module
forall u. ModuleName -&gt; GenModule (GenUnit u)
</span><a href="GHC.Unit.Module.html#mkHoleModule"><span class="hs-identifier hs-var">mkHoleModule</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211266"><span class="hs-identifier hs-var">modname</span></a></span><span>
</span><span id="line-620"></span><span class="annot"><a href="GHC.Driver.Backpack.html#convertHsModuleId"><span class="hs-identifier hs-var">convertHsModuleId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsModuleId"><span class="hs-identifier hs-type">HsModuleId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211265"><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211265"><span class="hs-identifier hs-var">hsuid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211264"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211264"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; ModuleName -&gt; Module
forall u. u -&gt; ModuleName -&gt; GenModule u
</span><a href="GHC.Unit.Types.html#mkModule"><span class="hs-identifier hs-var">mkModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnitId HsComponentId -&gt; Unit
</span><a href="GHC.Driver.Backpack.html#convertHsComponentId"><span class="hs-identifier hs-var">convertHsComponentId</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnitId HsComponentId
</span><a href="#local-6989586621681211265"><span class="hs-identifier hs-var">hsuid</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211264"><span class="hs-identifier hs-var">modname</span></a></span><span>
</span><span id="line-621"></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span>
</span><span id="line-624"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                        Module graph construction
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-631"></span><span>
</span><span id="line-632"></span><span class="hs-comment">-- | This is our version of GHC.Driver.Make.downsweep, but with a few modifications:</span><span>
</span><span id="line-633"></span><span class="hs-comment">--</span><span>
</span><span id="line-634"></span><span class="hs-comment">--  1. Every module is required to be mentioned, so we don't do any funny</span><span>
</span><span id="line-635"></span><span class="hs-comment">--     business with targets or recursively grabbing dependencies.  (We</span><span>
</span><span id="line-636"></span><span class="hs-comment">--     could support this in principle).</span><span>
</span><span id="line-637"></span><span class="hs-comment">--  2. We support inline modules, whose summary we have to synthesize ourself.</span><span>
</span><span id="line-638"></span><span class="hs-comment">--</span><span>
</span><span id="line-639"></span><span class="hs-comment">-- We don't bother trying to support GHC.Driver.Make for now, it's more trouble</span><span>
</span><span id="line-640"></span><span class="hs-comment">-- than it's worth for inline modules.</span><span>
</span><span id="line-641"></span><span class="annot"><a href="GHC.Driver.Backpack.html#hsunitModuleGraph"><span class="hs-identifier hs-type">hsunitModuleGraph</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsUnit"><span class="hs-identifier hs-type">HsUnit</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#HsComponentId"><span class="hs-identifier hs-type">HsComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModuleGraph"><span class="hs-identifier hs-type">ModuleGraph</span></a></span><span>
</span><span id="line-642"></span><span id="hsunitModuleGraph"><span class="annot"><span class="annottext">hsunitModuleGraph :: DynFlags -&gt; HsUnit HsComponentId -&gt; BkpM ModuleGraph
</span><a href="GHC.Driver.Backpack.html#hsunitModuleGraph"><span class="hs-identifier hs-var hs-var">hsunitModuleGraph</span></a></span></span><span> </span><span id="local-6989586621681211262"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211262"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681211261"><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211261"><span class="hs-keyword hs-var">unit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-643"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211260"><span class="annot"><span class="annottext">decls :: [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
</span><a href="#local-6989586621681211260"><span class="hs-identifier hs-var hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
forall n. HsUnit n -&gt; [LHsUnitDecl n]
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitBody"><span class="hs-identifier hs-var hs-var">hsunitBody</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211261"><span class="hs-keyword hs-var">unit</span></a></span><span>
</span><span id="line-644"></span><span>        </span><span id="local-6989586621681211259"><span class="annot"><span class="annottext">pn :: PackageName
</span><a href="#local-6989586621681211259"><span class="hs-identifier hs-var hs-var">pn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsComponentId -&gt; PackageName
</span><a href="GHC.Driver.Backpack.Syntax.html#hsPackageName"><span class="hs-identifier hs-var hs-var">hsPackageName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenLocated SrcSpan HsComponentId -&gt; HsComponentId
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsUnit HsComponentId -&gt; GenLocated SrcSpan HsComponentId
forall n. HsUnit n -&gt; Located n
</span><a href="GHC.Driver.Backpack.Syntax.html#hsunitName"><span class="hs-identifier hs-var hs-var">hsunitName</span></a></span><span> </span><span class="annot"><span class="annottext">HsUnit HsComponentId
</span><a href="#local-6989586621681211261"><span class="hs-keyword hs-var">unit</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span>    </span><span class="hs-comment">--  1. Create a HsSrcFile/HsigFile summary for every</span><span>
</span><span id="line-647"></span><span>    </span><span class="hs-comment">--  explicitly mentioned module/signature.</span><span>
</span><span id="line-648"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211255"><span class="annot"><span class="annottext">get_decl :: GenLocated l (HsUnitDecl n) -&gt; IOEnv BkpEnv (Maybe ModSummary)
</span><a href="#local-6989586621681211255"><span class="hs-identifier hs-var hs-var">get_decl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Backpack.Syntax.html#DeclD"><span class="hs-identifier hs-type">DeclD</span></a></span><span> </span><span id="local-6989586621681211254"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211254"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span id="local-6989586621681211253"><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211253"><span class="hs-identifier hs-var">lmodname</span></a></span></span><span> </span><span id="local-6989586621681211252"><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><a href="#local-6989586621681211252"><span class="hs-identifier hs-var">mb_hsmod</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-649"></span><span>          </span><span class="annot"><span class="annottext">ModSummary -&gt; Maybe ModSummary
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; Maybe ModSummary)
-&gt; IOEnv BkpEnv ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
-&gt; HscSource
-&gt; GenLocated SrcSpan ModuleName
-&gt; Maybe (Located HsModule)
-&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#summariseDecl"><span class="hs-identifier hs-var">summariseDecl</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211259"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211254"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211253"><span class="hs-identifier hs-var">lmodname</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><a href="#local-6989586621681211252"><span class="hs-identifier hs-var">mb_hsmod</span></a></span><span>
</span><span id="line-650"></span><span>        </span><span class="annot"><a href="#local-6989586621681211255"><span class="hs-identifier hs-var">get_decl</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated l (HsUnitDecl n)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModSummary
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-651"></span><span>    </span><span id="local-6989586621681211250"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681211250"><span class="hs-identifier hs-var">nodes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Maybe ModSummary] -&gt; [ModSummary]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">([Maybe ModSummary] -&gt; [ModSummary])
-&gt; IOEnv BkpEnv [Maybe ModSummary] -&gt; IOEnv BkpEnv [ModSummary]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-operator hs-var">`fmap`</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsUnitDecl HsComponentId)
 -&gt; IOEnv BkpEnv (Maybe ModSummary))
-&gt; [GenLocated SrcSpan (HsUnitDecl HsComponentId)]
-&gt; IOEnv BkpEnv [Maybe ModSummary]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsUnitDecl HsComponentId)
-&gt; IOEnv BkpEnv (Maybe ModSummary)
forall {l} {n}.
GenLocated l (HsUnitDecl n) -&gt; IOEnv BkpEnv (Maybe ModSummary)
</span><a href="#local-6989586621681211255"><span class="hs-identifier hs-var">get_decl</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated SrcSpan (HsUnitDecl HsComponentId)]
</span><a href="#local-6989586621681211260"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-652"></span><span>
</span><span id="line-653"></span><span>    </span><span class="hs-comment">--  2. For each hole which does not already have an hsig file,</span><span>
</span><span id="line-654"></span><span>    </span><span class="hs-comment">--  create an &quot;empty&quot; hsig file to induce compilation for the</span><span>
</span><span id="line-655"></span><span>    </span><span class="hs-comment">--  requirement.</span><span>
</span><span id="line-656"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211240"><span class="annot"><span class="annottext">node_map :: Map (ModuleName, Bool) ModSummary
</span><a href="#local-6989586621681211240"><span class="hs-identifier hs-var hs-var">node_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[((ModuleName, Bool), ModSummary)]
-&gt; Map (ModuleName, Bool) ModSummary
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModSummary -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#ms_mod_name"><span class="hs-identifier hs-var">ms_mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211239"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; HscSource
</span><a href="GHC.Driver.Types.html#ms_hsc_src"><span class="hs-identifier hs-var hs-var">ms_hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211239"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource -&gt; HscSource -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211239"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-657"></span><span>                                </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681211239"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211239"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681211250"><span class="hs-identifier hs-var">nodes</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-658"></span><span>    </span><span id="local-6989586621681211238"><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681211238"><span class="hs-identifier hs-var">req_nodes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">([Maybe ModSummary] -&gt; [ModSummary])
-&gt; IOEnv BkpEnv [Maybe ModSummary] -&gt; IOEnv BkpEnv [ModSummary]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">[Maybe ModSummary] -&gt; [ModSummary]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv BkpEnv [Maybe ModSummary] -&gt; IOEnv BkpEnv [ModSummary])
-&gt; (((ModuleName, Module) -&gt; IOEnv BkpEnv (Maybe ModSummary))
    -&gt; IOEnv BkpEnv [Maybe ModSummary])
-&gt; ((ModuleName, Module) -&gt; IOEnv BkpEnv (Maybe ModSummary))
-&gt; IOEnv BkpEnv [ModSummary]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[(ModuleName, Module)]
-&gt; ((ModuleName, Module) -&gt; IOEnv BkpEnv (Maybe ModSummary))
-&gt; IOEnv BkpEnv [Maybe ModSummary]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; [(ModuleName, Module)]
</span><a href="GHC.Driver.Session.html#homeUnitInstantiations"><span class="hs-identifier hs-var hs-var">homeUnitInstantiations</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211262"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(((ModuleName, Module) -&gt; IOEnv BkpEnv (Maybe ModSummary))
 -&gt; IOEnv BkpEnv [ModSummary])
-&gt; ((ModuleName, Module) -&gt; IOEnv BkpEnv (Maybe ModSummary))
-&gt; IOEnv BkpEnv [ModSummary]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681211236"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211236"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Module
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-659"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211232"><span class="annot"><span class="annottext">has_local :: Bool
</span><a href="#local-6989586621681211232"><span class="hs-identifier hs-var hs-var">has_local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModuleName, Bool) -&gt; Map (ModuleName, Bool) ModSummary -&gt; Bool
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Bool
</span><a href="../../containers/src/Data.Map.Internal.html#member"><span class="hs-identifier hs-var">Map.member</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211236"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map (ModuleName, Bool) ModSummary
</span><a href="#local-6989586621681211240"><span class="hs-identifier hs-var">node_map</span></a></span><span>
</span><span id="line-660"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211232"><span class="hs-identifier hs-var">has_local</span></a></span><span>
</span><span id="line-661"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ModSummary
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-662"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(ModSummary -&gt; Maybe ModSummary)
-&gt; IOEnv BkpEnv ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; Maybe ModSummary
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv BkpEnv ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary))
-&gt; IOEnv BkpEnv ModSummary -&gt; IOEnv BkpEnv (Maybe ModSummary)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; ModuleName -&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#summariseRequirement"><span class="hs-identifier hs-var">summariseRequirement</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211259"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211236"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-663"></span><span>
</span><span id="line-664"></span><span>    </span><span class="hs-comment">-- 3. Return the kaboodle</span><span>
</span><span id="line-665"></span><span>    </span><span class="annot"><span class="annottext">ModuleGraph -&gt; BkpM ModuleGraph
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ModuleGraph -&gt; BkpM ModuleGraph)
-&gt; ModuleGraph -&gt; BkpM ModuleGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; ModuleGraph
</span><a href="GHC.Driver.Types.html#mkModuleGraph"><span class="hs-identifier hs-var">mkModuleGraph</span></a></span><span> </span><span class="annot"><span class="annottext">([ModSummary] -&gt; ModuleGraph) -&gt; [ModSummary] -&gt; ModuleGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681211250"><span class="hs-identifier hs-var">nodes</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary] -&gt; [ModSummary] -&gt; [ModSummary]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[ModSummary]
</span><a href="#local-6989586621681211238"><span class="hs-identifier hs-var">req_nodes</span></a></span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span class="annot"><a href="GHC.Driver.Backpack.html#summariseRequirement"><span class="hs-identifier hs-type">summariseRequirement</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-668"></span><span id="summariseRequirement"><span class="annot"><span class="annottext">summariseRequirement :: PackageName -&gt; ModuleName -&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#summariseRequirement"><span class="hs-identifier hs-var hs-var">summariseRequirement</span></a></span></span><span> </span><span id="local-6989586621681211228"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211228"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span id="local-6989586621681211227"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-669"></span><span>    </span><span id="local-6989586621681211226"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211226"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-670"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211225"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681211225"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211226"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span id="local-6989586621681211224"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211224"><span class="hs-identifier hs-var">pn_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211228"><span class="hs-identifier hs-var">pn</span></a></span><span>
</span><span id="line-673"></span><span>    </span><span id="local-6989586621681211223"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211223"><span class="hs-identifier hs-var">location</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModLocation -&gt; IOEnv BkpEnv ModLocation
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModLocation -&gt; IOEnv BkpEnv ModLocation)
-&gt; IO ModLocation -&gt; IOEnv BkpEnv ModLocation
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; FilePath -&gt; FilePath -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var">mkHomeModLocation2</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211225"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-674"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211224"><span class="hs-identifier hs-var">pn_fs</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; FilePath
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hsig&quot;</span></span><span>
</span><span id="line-675"></span><span>
</span><span id="line-676"></span><span>    </span><span id="local-6989586621681211220"><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211220"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
</span><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-var">getBkpEnv</span></a></span><span>
</span><span id="line-677"></span><span>    </span><span id="local-6989586621681211219"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681211219"><span class="hs-identifier hs-var">time</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO UTCTime -&gt; IOEnv BkpEnv UTCTime
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO UTCTime -&gt; IOEnv BkpEnv UTCTime)
-&gt; IO UTCTime -&gt; IOEnv BkpEnv UTCTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO UTCTime
</span><a href="GHC.Utils.Misc.html#getModificationUTCTime"><span class="hs-identifier hs-var">getModificationUTCTime</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BkpEnv -&gt; FilePath
</span><a href="GHC.Driver.Backpack.html#bkp_filename"><span class="hs-identifier hs-var hs-var">bkp_filename</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211220"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-678"></span><span>    </span><span id="local-6989586621681211217"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211217"><span class="hs-identifier hs-var">hi_timestamp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime))
-&gt; IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO (Maybe UTCTime)
</span><a href="GHC.Utils.Misc.html#modificationTimeIfExists"><span class="hs-identifier hs-var">modificationTimeIfExists</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hi_file"><span class="hs-identifier hs-var hs-var">ml_hi_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211223"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-679"></span><span>    </span><span id="local-6989586621681211214"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211214"><span class="hs-identifier hs-var">hie_timestamp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime))
-&gt; IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO (Maybe UTCTime)
</span><a href="GHC.Utils.Misc.html#modificationTimeIfExists"><span class="hs-identifier hs-var">modificationTimeIfExists</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hie_file"><span class="hs-identifier hs-var hs-var">ml_hie_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211223"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-680"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211212"><span class="annot"><span class="annottext">loc :: SrcSpan
</span><a href="#local-6989586621681211212"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcLoc -&gt; SrcSpan
</span><a href="GHC.Types.SrcLoc.html#srcLocSpan"><span class="hs-identifier hs-var">srcLocSpan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Int -&gt; Int -&gt; SrcLoc
</span><a href="GHC.Types.SrcLoc.html#mkSrcLoc"><span class="hs-identifier hs-var">mkSrcLoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BkpEnv -&gt; FilePath
</span><a href="GHC.Driver.Backpack.html#bkp_filename"><span class="hs-identifier hs-var hs-var">bkp_filename</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211220"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-681"></span><span>
</span><span id="line-682"></span><span>    </span><span id="local-6989586621681211209"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211209"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Module -&gt; IOEnv BkpEnv Module
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Module -&gt; IOEnv BkpEnv Module)
-&gt; IO Module -&gt; IOEnv BkpEnv Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; ModLocation -&gt; IO Module
</span><a href="GHC.Driver.Finder.html#addHomeModuleToFinder"><span class="hs-identifier hs-var">addHomeModuleToFinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211226"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211223"><span class="hs-identifier hs-var">location</span></a></span><span>
</span><span id="line-683"></span><span>
</span><span id="line-684"></span><span>    </span><span id="local-6989586621681211207"><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211207"><span class="hs-identifier hs-var">extra_sig_imports</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
 -&gt; IOEnv
      BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)])
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; HscSource
-&gt; ModuleName
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Tc.Utils.Backpack.html#findExtraSigImports"><span class="hs-identifier hs-var">findExtraSigImports</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211226"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-685"></span><span>
</span><span id="line-686"></span><span>    </span><span class="annot"><span class="annottext">ModSummary -&gt; IOEnv BkpEnv ModSummary
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary :: Module
-&gt; HscSource
-&gt; ModLocation
-&gt; UTCTime
-&gt; Maybe UTCTime
-&gt; Maybe UTCTime
-&gt; Maybe UTCTime
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; Maybe HsParsedModule
-&gt; FilePath
-&gt; DynFlags
-&gt; Maybe StringBuffer
-&gt; ModSummary
</span><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-687"></span><span>        </span><span class="annot"><span class="annottext">ms_mod :: Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var">ms_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211209"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-688"></span><span>        </span><span class="annot"><span class="annottext">ms_hsc_src :: HscSource
</span><a href="GHC.Driver.Types.html#ms_hsc_src"><span class="hs-identifier hs-var">ms_hsc_src</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-689"></span><span>        </span><span class="annot"><span class="annottext">ms_location :: ModLocation
</span><a href="GHC.Driver.Types.html#ms_location"><span class="hs-identifier hs-var">ms_location</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211223"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-690"></span><span>        </span><span class="annot"><span class="annottext">ms_hs_date :: UTCTime
</span><a href="GHC.Driver.Types.html#ms_hs_date"><span class="hs-identifier hs-var">ms_hs_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681211219"><span class="hs-identifier hs-var">time</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-691"></span><span>        </span><span class="annot"><span class="annottext">ms_obj_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_obj_date"><span class="hs-identifier hs-var">ms_obj_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-692"></span><span>        </span><span class="annot"><span class="annottext">ms_iface_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_iface_date"><span class="hs-identifier hs-var">ms_iface_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211217"><span class="hs-identifier hs-var">hi_timestamp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-693"></span><span>        </span><span class="annot"><span class="annottext">ms_hie_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_hie_date"><span class="hs-identifier hs-var">ms_hie_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211214"><span class="hs-identifier hs-var">hie_timestamp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-694"></span><span>        </span><span class="annot"><span class="annottext">ms_srcimps :: [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_srcimps"><span class="hs-identifier hs-var">ms_srcimps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-695"></span><span>        </span><span class="annot"><span class="annottext">ms_textual_imps :: [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_textual_imps"><span class="hs-identifier hs-var">ms_textual_imps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211207"><span class="hs-identifier hs-var">extra_sig_imports</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-696"></span><span>        </span><span class="annot"><span class="annottext">ms_parsed_mod :: Maybe HsParsedModule
</span><a href="GHC.Driver.Types.html#ms_parsed_mod"><span class="hs-identifier hs-var">ms_parsed_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsParsedModule -&gt; Maybe HsParsedModule
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsParsedModule :: Located HsModule -&gt; [FilePath] -&gt; ApiAnns -&gt; HsParsedModule
</span><a href="GHC.Driver.Types.html#HsParsedModule"><span class="hs-identifier hs-type">HsParsedModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-697"></span><span>                </span><span class="annot"><span class="annottext">hpm_module :: Located HsModule
</span><a href="GHC.Driver.Types.html#hpm_module"><span class="hs-identifier hs-var">hpm_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsModule -&gt; Located HsModule
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681211212"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsModule :: LayoutInfo
-&gt; Maybe (GenLocated SrcSpan ModuleName)
-&gt; Maybe (Located [LIE GhcPs])
-&gt; [LImportDecl GhcPs]
-&gt; [LHsDecl GhcPs]
-&gt; Maybe (Located WarningTxt)
-&gt; Maybe LHsDocString
-&gt; HsModule
</span><a href="GHC.Hs.html#HsModule"><span class="hs-identifier hs-type">HsModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-698"></span><span>                        </span><span class="annot"><span class="annottext">hsmodLayout :: LayoutInfo
</span><a href="GHC.Hs.html#hsmodLayout"><span class="hs-identifier hs-var">hsmodLayout</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LayoutInfo
</span><a href="GHC.Types.SrcLoc.html#NoLayoutInfo"><span class="hs-identifier hs-var">NoLayoutInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-699"></span><span>                        </span><span class="annot"><span class="annottext">hsmodName :: Maybe (GenLocated SrcSpan ModuleName)
</span><a href="GHC.Hs.html#hsmodName"><span class="hs-identifier hs-var">hsmodName</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
-&gt; Maybe (GenLocated SrcSpan ModuleName)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; ModuleName -&gt; GenLocated SrcSpan ModuleName
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681211212"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211227"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-700"></span><span>                        </span><span class="annot"><span class="annottext">hsmodExports :: Maybe (Located [LIE GhcPs])
</span><a href="GHC.Hs.html#hsmodExports"><span class="hs-identifier hs-var">hsmodExports</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Located [LIE GhcPs])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-701"></span><span>                        </span><span class="annot"><span class="annottext">hsmodImports :: [LImportDecl GhcPs]
</span><a href="GHC.Hs.html#hsmodImports"><span class="hs-identifier hs-var">hsmodImports</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-702"></span><span>                        </span><span class="annot"><span class="annottext">hsmodDecls :: [LHsDecl GhcPs]
</span><a href="GHC.Hs.html#hsmodDecls"><span class="hs-identifier hs-var">hsmodDecls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-703"></span><span>                        </span><span class="annot"><span class="annottext">hsmodDeprecMessage :: Maybe (Located WarningTxt)
</span><a href="GHC.Hs.html#hsmodDeprecMessage"><span class="hs-identifier hs-var">hsmodDeprecMessage</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Located WarningTxt)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-704"></span><span>                        </span><span class="annot"><span class="annottext">hsmodHaddockModHeader :: Maybe LHsDocString
</span><a href="GHC.Hs.html#hsmodHaddockModHeader"><span class="hs-identifier hs-var">hsmodHaddockModHeader</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe LHsDocString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-705"></span><span>                    </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-706"></span><span>                </span><span class="annot"><span class="annottext">hpm_src_files :: [FilePath]
</span><a href="GHC.Driver.Types.html#hpm_src_files"><span class="hs-identifier hs-var">hpm_src_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-707"></span><span>                </span><span class="annot"><span class="annottext">hpm_annotations :: ApiAnns
</span><a href="GHC.Driver.Types.html#hpm_annotations"><span class="hs-identifier hs-var">hpm_annotations</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map ApiAnnKey [RealSrcSpan]
-&gt; Maybe RealSrcSpan
-&gt; Map RealSrcSpan [RealLocated AnnotationComment]
-&gt; [RealLocated AnnotationComment]
-&gt; ApiAnns
</span><a href="GHC.Parser.Annotation.html#ApiAnns"><span class="hs-identifier hs-var">ApiAnns</span></a></span><span> </span><span class="annot"><span class="annottext">Map ApiAnnKey [RealSrcSpan]
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe RealSrcSpan
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Map RealSrcSpan [RealLocated AnnotationComment]
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-708"></span><span>            </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-709"></span><span>        </span><span class="annot"><span class="annottext">ms_hspp_file :: FilePath
</span><a href="GHC.Driver.Types.html#ms_hspp_file"><span class="hs-identifier hs-var">ms_hspp_file</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- none, it came inline</span><span>
</span><span id="line-710"></span><span>        </span><span class="annot"><span class="annottext">ms_hspp_opts :: DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var">ms_hspp_opts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211225"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-711"></span><span>        </span><span class="annot"><span class="annottext">ms_hspp_buf :: Maybe StringBuffer
</span><a href="GHC.Driver.Types.html#ms_hspp_buf"><span class="hs-identifier hs-var">ms_hspp_buf</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe StringBuffer
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-712"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-713"></span><span>
</span><span id="line-714"></span><span class="annot"><a href="GHC.Driver.Backpack.html#summariseDecl"><span class="hs-identifier hs-type">summariseDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span>
</span><span id="line-715"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#HscSource"><span class="hs-identifier hs-type">HscSource</span></a></span><span>
</span><span id="line-716"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-717"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.html#HsModule"><span class="hs-identifier hs-type">HsModule</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-718"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-719"></span><span id="summariseDecl"><span class="annot"><span class="annottext">summariseDecl :: PackageName
-&gt; HscSource
-&gt; GenLocated SrcSpan ModuleName
-&gt; Maybe (Located HsModule)
-&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#summariseDecl"><span class="hs-identifier hs-var hs-var">summariseDecl</span></a></span></span><span> </span><span id="local-6989586621681211178"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211178"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span id="local-6989586621681211177"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211177"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211176"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211176"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211175"><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211175"><span class="hs-identifier hs-var">hsmod</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName
-&gt; HscSource
-&gt; ModuleName
-&gt; Located HsModule
-&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#hsModuleToModSummary"><span class="hs-identifier hs-var">hsModuleToModSummary</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211178"><span class="hs-identifier hs-var">pn</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211177"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211176"><span class="hs-identifier hs-var">modname</span></a></span><span> </span><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211175"><span class="hs-identifier hs-var">hsmod</span></a></span><span>
</span><span id="line-720"></span><span class="annot"><a href="GHC.Driver.Backpack.html#summariseDecl"><span class="hs-identifier hs-var">summariseDecl</span></a></span><span> </span><span id="local-6989586621681211173"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211173"><span class="hs-identifier hs-var">_pn</span></a></span></span><span> </span><span id="local-6989586621681211172"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211172"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span id="local-6989586621681211171"><span class="annot"><span class="annottext">lmodname :: GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211171"><span class="hs-identifier hs-var">lmodname</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681211170"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681211170"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681211169"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211169"><span class="hs-identifier hs-var">modname</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (Located HsModule)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-721"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681211168"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211168"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-722"></span><span>         </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211167"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681211167"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211168"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-723"></span><span>         </span><span class="hs-comment">-- TODO: this looks for modules in the wrong place</span><span>
</span><span id="line-724"></span><span>         </span><span id="local-6989586621681211166"><span class="annot"><span class="annottext">Maybe (Either ErrorMessages ModSummary)
</span><a href="#local-6989586621681211166"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe (Either ErrorMessages ModSummary))
-&gt; IOEnv BkpEnv (Maybe (Either ErrorMessages ModSummary))
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe (Either ErrorMessages ModSummary))
 -&gt; IOEnv BkpEnv (Maybe (Either ErrorMessages ModSummary)))
-&gt; IO (Maybe (Either ErrorMessages ModSummary))
-&gt; IOEnv BkpEnv (Maybe (Either ErrorMessages ModSummary))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; NodeMap ModSummary
-&gt; IsBootInterface
-&gt; GenLocated SrcSpan ModuleName
-&gt; Bool
-&gt; Maybe (StringBuffer, UTCTime)
-&gt; [ModuleName]
-&gt; IO (Maybe (Either ErrorMessages ModSummary))
</span><a href="GHC.Driver.Make.html#summariseModule"><span class="hs-identifier hs-var">summariseModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211168"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-725"></span><span>                         </span><span class="annot"><span class="annottext">NodeMap ModSummary
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="hs-comment">-- GHC API recomp not supported</span><span>
</span><span id="line-726"></span><span>                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscSource -&gt; IsBootInterface
</span><a href="GHC.Driver.Make.html#hscSourceToIsBoot"><span class="hs-identifier hs-var">hscSourceToIsBoot</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211172"><span class="hs-identifier hs-var">hsc_src</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-727"></span><span>                         </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName
</span><a href="#local-6989586621681211171"><span class="hs-identifier hs-var">lmodname</span></a></span><span>
</span><span id="line-728"></span><span>                         </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-comment">-- Target lets you disallow, but not here</span><span>
</span><span id="line-729"></span><span>                         </span><span class="annot"><span class="annottext">Maybe (StringBuffer, UTCTime)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-comment">-- GHC API buffer support not supported</span><span>
</span><span id="line-730"></span><span>                         </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- No exclusions</span><span>
</span><span id="line-731"></span><span>         </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (Either ErrorMessages ModSummary)
</span><a href="#local-6989586621681211166"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-732"></span><span>            </span><span class="annot"><span class="annottext">Maybe (Either ErrorMessages ModSummary)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrMsg -&gt; IOEnv BkpEnv ModSummary
forall (io :: * -&gt; *) a. MonadIO io =&gt; ErrMsg -&gt; io a
</span><a href="GHC.Driver.Types.html#throwOneError"><span class="hs-identifier hs-var">throwOneError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; SDoc -&gt; ErrMsg
</span><a href="GHC.Utils.Error.html#mkPlainErrMsg"><span class="hs-identifier hs-var">mkPlainErrMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211167"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681211170"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;module&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211169"><span class="hs-identifier hs-var">modname</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;was not found&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-733"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681211161"><span class="annot"><span class="annottext">ErrorMessages
</span><a href="#local-6989586621681211161"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorMessages -&gt; IOEnv BkpEnv ModSummary
forall (io :: * -&gt; *) a. MonadIO io =&gt; ErrorMessages -&gt; io a
</span><a href="GHC.Driver.Types.html#throwErrors"><span class="hs-identifier hs-var">throwErrors</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorMessages
</span><a href="#local-6989586621681211161"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-734"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681211160"><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211160"><span class="hs-identifier hs-var">summary</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModSummary -&gt; IOEnv BkpEnv ModSummary
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary
</span><a href="#local-6989586621681211160"><span class="hs-identifier hs-var">summary</span></a></span><span>
</span><span id="line-735"></span><span>
</span><span id="line-736"></span><span class="hs-comment">-- | Up until now, GHC has assumed a single compilation target per source file.</span><span>
</span><span id="line-737"></span><span class="hs-comment">-- Backpack files with inline modules break this model, since a single file</span><span>
</span><span id="line-738"></span><span class="hs-comment">-- may generate multiple output files.  How do we decide to name these files?</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- Should there only be one output file? This function our current heuristic,</span><span>
</span><span id="line-740"></span><span class="hs-comment">-- which is we make a &quot;fake&quot; module and use that.</span><span>
</span><span id="line-741"></span><span class="annot"><a href="GHC.Driver.Backpack.html#hsModuleToModSummary"><span class="hs-identifier hs-type">hsModuleToModSummary</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span>
</span><span id="line-742"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Phases.html#HscSource"><span class="hs-identifier hs-type">HscSource</span></a></span><span>
</span><span id="line-743"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-744"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.html#HsModule"><span class="hs-identifier hs-type">HsModule</span></a></span><span>
</span><span id="line-745"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Backpack.html#BkpM"><span class="hs-identifier hs-type">BkpM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span>
</span><span id="line-746"></span><span id="hsModuleToModSummary"><span class="annot"><span class="annottext">hsModuleToModSummary :: PackageName
-&gt; HscSource
-&gt; ModuleName
-&gt; Located HsModule
-&gt; IOEnv BkpEnv ModSummary
</span><a href="GHC.Driver.Backpack.html#hsModuleToModSummary"><span class="hs-identifier hs-var hs-var">hsModuleToModSummary</span></a></span></span><span> </span><span id="local-6989586621681211159"><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211159"><span class="hs-identifier hs-var">pn</span></a></span></span><span> </span><span id="local-6989586621681211158"><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211158"><span class="hs-identifier hs-var">hsc_src</span></a></span></span><span> </span><span id="local-6989586621681211157"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span></span><span>
</span><span id="line-747"></span><span>                     </span><span id="local-6989586621681211156"><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211156"><span class="hs-identifier hs-var">hsmod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-748"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211155"><span class="annot"><span class="annottext">imps :: [LImportDecl GhcPs]
</span><a href="#local-6989586621681211155"><span class="hs-identifier hs-var hs-var">imps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsModule -&gt; [LImportDecl GhcPs]
</span><a href="GHC.Hs.html#hsmodImports"><span class="hs-identifier hs-var hs-var">hsmodImports</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located HsModule -&gt; HsModule
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211156"><span class="hs-identifier hs-var">hsmod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-749"></span><span>        </span><span id="local-6989586621681211154"><span class="annot"><span class="annottext">loc :: SrcSpan
</span><a href="#local-6989586621681211154"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located HsModule -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211156"><span class="hs-identifier hs-var">hsmod</span></a></span><span>
</span><span id="line-750"></span><span>    </span><span id="local-6989586621681211152"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211152"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv BkpEnv HscEnv
forall (m :: * -&gt; *). GhcMonad m =&gt; m HscEnv
</span><a href="GHC.Driver.Monad.html#getSession"><span class="hs-identifier hs-var">getSession</span></a></span><span>
</span><span id="line-751"></span><span>    </span><span class="hs-comment">-- Sort of the same deal as in GHC.Driver.Pipeline's getLocation</span><span>
</span><span id="line-752"></span><span>    </span><span class="hs-comment">-- Use the PACKAGE NAME to find the location</span><span>
</span><span id="line-753"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#PackageName"><span class="hs-identifier hs-type">PackageName</span></a></span><span> </span><span id="local-6989586621681211151"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211151"><span class="hs-identifier hs-var">unit_fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="#local-6989586621681211159"><span class="hs-identifier hs-var">pn</span></a></span><span>
</span><span id="line-754"></span><span>        </span><span id="local-6989586621681211150"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681211150"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211152"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-755"></span><span>    </span><span class="hs-comment">-- Unfortunately, we have to define a &quot;fake&quot; location in</span><span>
</span><span id="line-756"></span><span>    </span><span class="hs-comment">-- order to appease the various code which uses the file</span><span>
</span><span id="line-757"></span><span>    </span><span class="hs-comment">-- name to figure out where to put, e.g. object files.</span><span>
</span><span id="line-758"></span><span>    </span><span class="hs-comment">-- To add insult to injury, we don't even actually use</span><span>
</span><span id="line-759"></span><span>    </span><span class="hs-comment">-- these filenames to figure out where the hi files go.</span><span>
</span><span id="line-760"></span><span>    </span><span class="hs-comment">-- A travesty!</span><span>
</span><span id="line-761"></span><span>    </span><span id="local-6989586621681211149"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211149"><span class="hs-identifier hs-var">location0</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModLocation -&gt; IOEnv BkpEnv ModLocation
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO ModLocation -&gt; IOEnv BkpEnv ModLocation)
-&gt; IO ModLocation -&gt; IOEnv BkpEnv ModLocation
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; FilePath -&gt; FilePath -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var">mkHomeModLocation2</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211150"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span>
</span><span id="line-762"></span><span>                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; FilePath
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211151"><span class="hs-identifier hs-var">unit_fs</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span>
</span><span id="line-763"></span><span>                              </span><span class="annot"><span class="annottext">ModuleName -&gt; FilePath
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-764"></span><span>                              </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211158"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-765"></span><span>                                </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsigFile"><span class="hs-identifier hs-var">HsigFile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hsig&quot;</span></span><span>
</span><span id="line-766"></span><span>                                </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsBootFile"><span class="hs-identifier hs-var">HsBootFile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hs-boot&quot;</span></span><span>
</span><span id="line-767"></span><span>                                </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsSrcFile"><span class="hs-identifier hs-var">HsSrcFile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hs&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-768"></span><span>    </span><span class="hs-comment">-- DANGEROUS: bootifying can POISON the module finder cache</span><span>
</span><span id="line-769"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211148"><span class="annot"><span class="annottext">location :: ModLocation
</span><a href="#local-6989586621681211148"><span class="hs-identifier hs-var hs-var">location</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211158"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-770"></span><span>                        </span><span class="annot"><span class="annottext">HscSource
</span><a href="GHC.Driver.Phases.html#HsBootFile"><span class="hs-identifier hs-var">HsBootFile</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; ModLocation
</span><a href="GHC.Unit.Module.Location.html#addBootSuffixLocnOut"><span class="hs-identifier hs-var">addBootSuffixLocnOut</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211149"><span class="hs-identifier hs-var">location0</span></a></span><span>
</span><span id="line-771"></span><span>                        </span><span class="annot"><span class="annottext">HscSource
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211149"><span class="hs-identifier hs-var">location0</span></a></span><span>
</span><span id="line-772"></span><span>    </span><span class="hs-comment">-- This duplicates a pile of logic in GHC.Driver.Make</span><span>
</span><span id="line-773"></span><span>    </span><span id="local-6989586621681211146"><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211146"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">BkpM BkpEnv
</span><a href="GHC.Driver.Backpack.html#getBkpEnv"><span class="hs-identifier hs-var">getBkpEnv</span></a></span><span>
</span><span id="line-774"></span><span>    </span><span id="local-6989586621681211145"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681211145"><span class="hs-identifier hs-var">time</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO UTCTime -&gt; IOEnv BkpEnv UTCTime
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO UTCTime -&gt; IOEnv BkpEnv UTCTime)
-&gt; IO UTCTime -&gt; IOEnv BkpEnv UTCTime
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO UTCTime
</span><a href="GHC.Utils.Misc.html#getModificationUTCTime"><span class="hs-identifier hs-var">getModificationUTCTime</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">BkpEnv -&gt; FilePath
</span><a href="GHC.Driver.Backpack.html#bkp_filename"><span class="hs-identifier hs-var hs-var">bkp_filename</span></a></span><span> </span><span class="annot"><span class="annottext">BkpEnv
</span><a href="#local-6989586621681211146"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-775"></span><span>    </span><span id="local-6989586621681211144"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211144"><span class="hs-identifier hs-var">hi_timestamp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime))
-&gt; IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO (Maybe UTCTime)
</span><a href="GHC.Utils.Misc.html#modificationTimeIfExists"><span class="hs-identifier hs-var">modificationTimeIfExists</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hi_file"><span class="hs-identifier hs-var hs-var">ml_hi_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211148"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-776"></span><span>    </span><span id="local-6989586621681211143"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211143"><span class="hs-identifier hs-var">hie_timestamp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime))
-&gt; IO (Maybe UTCTime) -&gt; IOEnv BkpEnv (Maybe UTCTime)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO (Maybe UTCTime)
</span><a href="GHC.Utils.Misc.html#modificationTimeIfExists"><span class="hs-identifier hs-var">modificationTimeIfExists</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; FilePath
</span><a href="GHC.Unit.Module.Location.html#ml_hie_file"><span class="hs-identifier hs-var hs-var">ml_hie_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211148"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span>    </span><span class="hs-comment">-- Also copied from 'getImports'</span><span>
</span><span id="line-779"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681211140"><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211140"><span class="hs-identifier hs-var">src_idecls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681211139"><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211139"><span class="hs-identifier hs-var">ord_idecls</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LImportDecl GhcPs -&gt; Bool)
-&gt; [LImportDecl GhcPs]
-&gt; ([LImportDecl GhcPs], [LImportDecl GhcPs])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsBootInterface -&gt; IsBootInterface -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">IsBootInterface
</span><a href="GHC.Unit.Types.html#IsBoot"><span class="hs-identifier hs-var">IsBoot</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IsBootInterface -&gt; Bool)
-&gt; (LImportDecl GhcPs -&gt; IsBootInterface)
-&gt; LImportDecl GhcPs
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ImportDecl GhcPs -&gt; IsBootInterface
forall pass. ImportDecl pass -&gt; IsBootInterface
</span><a href="GHC.Hs.ImpExp.html#ideclSource"><span class="hs-identifier hs-var hs-var">ideclSource</span></a></span><span> </span><span class="annot"><span class="annottext">(ImportDecl GhcPs -&gt; IsBootInterface)
-&gt; (LImportDecl GhcPs -&gt; ImportDecl GhcPs)
-&gt; LImportDecl GhcPs
-&gt; IsBootInterface
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LImportDecl GhcPs -&gt; ImportDecl GhcPs
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211155"><span class="hs-identifier hs-var">imps</span></a></span><span>
</span><span id="line-780"></span><span>
</span><span id="line-781"></span><span>             </span><span class="hs-comment">-- GHC.Prim doesn't exist physically, so don't go looking for it.</span><span>
</span><span id="line-782"></span><span>        </span><span id="local-6989586621681211134"><span class="annot"><span class="annottext">ordinary_imps :: [LImportDecl GhcPs]
</span><a href="#local-6989586621681211134"><span class="hs-identifier hs-var hs-var">ordinary_imps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LImportDecl GhcPs -&gt; Bool)
-&gt; [LImportDecl GhcPs] -&gt; [LImportDecl GhcPs]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="GHC.Builtin.Names.html#gHC_PRIM"><span class="hs-identifier hs-var">gHC_PRIM</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(ModuleName -&gt; Bool)
-&gt; (LImportDecl GhcPs -&gt; ModuleName) -&gt; LImportDecl GhcPs -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan ModuleName -&gt; ModuleName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan ModuleName -&gt; ModuleName)
-&gt; (LImportDecl GhcPs -&gt; GenLocated SrcSpan ModuleName)
-&gt; LImportDecl GhcPs
-&gt; ModuleName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ImportDecl GhcPs -&gt; GenLocated SrcSpan ModuleName
forall pass. ImportDecl pass -&gt; GenLocated SrcSpan ModuleName
</span><a href="GHC.Hs.ImpExp.html#ideclName"><span class="hs-identifier hs-var hs-var">ideclName</span></a></span><span> </span><span class="annot"><span class="annottext">(ImportDecl GhcPs -&gt; GenLocated SrcSpan ModuleName)
-&gt; (LImportDecl GhcPs -&gt; ImportDecl GhcPs)
-&gt; LImportDecl GhcPs
-&gt; GenLocated SrcSpan ModuleName
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LImportDecl GhcPs -&gt; ImportDecl GhcPs
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-783"></span><span>                               </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211139"><span class="hs-identifier hs-var">ord_idecls</span></a></span><span>
</span><span id="line-784"></span><span>
</span><span id="line-785"></span><span>        </span><span id="local-6989586621681211130"><span class="annot"><span class="annottext">implicit_prelude :: Bool
</span><a href="#local-6989586621681211130"><span class="hs-identifier hs-var hs-var">implicit_prelude</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#ImplicitPrelude"><span class="hs-identifier hs-var">LangExt.ImplicitPrelude</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211150"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-786"></span><span>        </span><span id="local-6989586621681211127"><span class="annot"><span class="annottext">implicit_imports :: [LImportDecl GhcPs]
</span><a href="#local-6989586621681211127"><span class="hs-identifier hs-var hs-var">implicit_imports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName
-&gt; SrcSpan -&gt; Bool -&gt; [LImportDecl GhcPs] -&gt; [LImportDecl GhcPs]
</span><a href="GHC.Parser.Header.html#mkPrelImports"><span class="hs-identifier hs-var">mkPrelImports</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681211154"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-787"></span><span>                                         </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681211130"><span class="hs-identifier hs-var">implicit_prelude</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211155"><span class="hs-identifier hs-var">imps</span></a></span><span>
</span><span id="line-788"></span><span>        </span><span id="local-6989586621681211123"><span class="annot"><span class="annottext">convImport :: GenLocated l (ImportDecl pass)
-&gt; (Maybe FastString, GenLocated SrcSpan ModuleName)
</span><a href="#local-6989586621681211123"><span class="hs-identifier hs-var hs-var">convImport</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681211122"><span class="annot"><span class="annottext">ImportDecl pass
</span><a href="#local-6989586621681211122"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(StringLiteral -&gt; FastString)
-&gt; Maybe StringLiteral -&gt; Maybe FastString
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">StringLiteral -&gt; FastString
</span><a href="GHC.Types.Basic.html#sl_fs"><span class="hs-identifier hs-var hs-var">sl_fs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportDecl pass -&gt; Maybe StringLiteral
forall pass. ImportDecl pass -&gt; Maybe StringLiteral
</span><a href="GHC.Hs.ImpExp.html#ideclPkgQual"><span class="hs-identifier hs-var hs-var">ideclPkgQual</span></a></span><span> </span><span class="annot"><span class="annottext">ImportDecl pass
</span><a href="#local-6989586621681211122"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ImportDecl pass -&gt; GenLocated SrcSpan ModuleName
forall pass. ImportDecl pass -&gt; GenLocated SrcSpan ModuleName
</span><a href="GHC.Hs.ImpExp.html#ideclName"><span class="hs-identifier hs-var hs-var">ideclName</span></a></span><span> </span><span class="annot"><span class="annottext">ImportDecl pass
</span><a href="#local-6989586621681211122"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-789"></span><span>
</span><span id="line-790"></span><span>    </span><span id="local-6989586621681211119"><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211119"><span class="hs-identifier hs-var">extra_sig_imports</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
 -&gt; IOEnv
      BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)])
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; HscSource
-&gt; ModuleName
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Tc.Utils.Backpack.html#findExtraSigImports"><span class="hs-identifier hs-var">findExtraSigImports</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211152"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211158"><span class="hs-identifier hs-var">hsc_src</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span>
</span><span id="line-791"></span><span>
</span><span id="line-792"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681211118"><span class="annot"><span class="annottext">normal_imports :: [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211118"><span class="hs-identifier hs-var hs-var">normal_imports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LImportDecl GhcPs
 -&gt; (Maybe FastString, GenLocated SrcSpan ModuleName))
-&gt; [LImportDecl GhcPs]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LImportDecl GhcPs
-&gt; (Maybe FastString, GenLocated SrcSpan ModuleName)
forall {l} {pass}.
GenLocated l (ImportDecl pass)
-&gt; (Maybe FastString, GenLocated SrcSpan ModuleName)
</span><a href="#local-6989586621681211123"><span class="hs-identifier hs-var">convImport</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211127"><span class="hs-identifier hs-var">implicit_imports</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs] -&gt; [LImportDecl GhcPs] -&gt; [LImportDecl GhcPs]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211134"><span class="hs-identifier hs-var">ordinary_imps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-793"></span><span>    </span><span id="local-6989586621681211117"><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211117"><span class="hs-identifier hs-var">required_by_imports</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
 -&gt; IOEnv
      BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)])
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IOEnv BkpEnv [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; IO [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Tc.Utils.Backpack.html#implicitRequirements"><span class="hs-identifier hs-var">implicitRequirements</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211152"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211118"><span class="hs-identifier hs-var">normal_imports</span></a></span><span>
</span><span id="line-794"></span><span>
</span><span id="line-795"></span><span>    </span><span class="hs-comment">-- So that Finder can find it, even though it doesn't exist...</span><span>
</span><span id="line-796"></span><span>    </span><span id="local-6989586621681211115"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211115"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Module -&gt; IOEnv BkpEnv Module
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO Module -&gt; IOEnv BkpEnv Module)
-&gt; IO Module -&gt; IOEnv BkpEnv Module
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; ModLocation -&gt; IO Module
</span><a href="GHC.Driver.Finder.html#addHomeModuleToFinder"><span class="hs-identifier hs-var">addHomeModuleToFinder</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681211152"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211148"><span class="hs-identifier hs-var">location</span></a></span><span>
</span><span id="line-797"></span><span>    </span><span class="annot"><span class="annottext">ModSummary -&gt; IOEnv BkpEnv ModSummary
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModSummary :: Module
-&gt; HscSource
-&gt; ModLocation
-&gt; UTCTime
-&gt; Maybe UTCTime
-&gt; Maybe UTCTime
-&gt; Maybe UTCTime
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; Maybe HsParsedModule
-&gt; FilePath
-&gt; DynFlags
-&gt; Maybe StringBuffer
-&gt; ModSummary
</span><a href="GHC.Driver.Types.html#ModSummary"><span class="hs-identifier hs-type">ModSummary</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-798"></span><span>            </span><span class="annot"><span class="annottext">ms_mod :: Module
</span><a href="GHC.Driver.Types.html#ms_mod"><span class="hs-identifier hs-var">ms_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681211115"><span class="hs-identifier hs-var">this_mod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-799"></span><span>            </span><span class="annot"><span class="annottext">ms_hsc_src :: HscSource
</span><a href="GHC.Driver.Types.html#ms_hsc_src"><span class="hs-identifier hs-var">ms_hsc_src</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscSource
</span><a href="#local-6989586621681211158"><span class="hs-identifier hs-var">hsc_src</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-800"></span><span>            </span><span class="annot"><span class="annottext">ms_location :: ModLocation
</span><a href="GHC.Driver.Types.html#ms_location"><span class="hs-identifier hs-var">ms_location</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621681211148"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-801"></span><span>            </span><span class="annot"><span class="annottext">ms_hspp_file :: FilePath
</span><a href="GHC.Driver.Types.html#ms_hspp_file"><span class="hs-identifier hs-var">ms_hspp_file</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe FilePath
</span><a href="GHC.Driver.Session.html#hiDir"><span class="hs-identifier hs-var hs-var">hiDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211150"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-802"></span><span>                            </span><span class="annot"><span class="annottext">Maybe FilePath
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-803"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211114"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211114"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621681211114"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;..&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; FilePath
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681211157"><span class="hs-identifier hs-var">modname</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; FilePath
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;hi&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-804"></span><span>            </span><span class="annot"><span class="annottext">ms_hspp_opts :: DynFlags
</span><a href="GHC.Driver.Types.html#ms_hspp_opts"><span class="hs-identifier hs-var">ms_hspp_opts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681211150"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-805"></span><span>            </span><span class="annot"><span class="annottext">ms_hspp_buf :: Maybe StringBuffer
</span><a href="GHC.Driver.Types.html#ms_hspp_buf"><span class="hs-identifier hs-var">ms_hspp_buf</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe StringBuffer
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-806"></span><span>            </span><span class="annot"><span class="annottext">ms_srcimps :: [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_srcimps"><span class="hs-identifier hs-var">ms_srcimps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LImportDecl GhcPs
 -&gt; (Maybe FastString, GenLocated SrcSpan ModuleName))
-&gt; [LImportDecl GhcPs]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LImportDecl GhcPs
-&gt; (Maybe FastString, GenLocated SrcSpan ModuleName)
forall {l} {pass}.
GenLocated l (ImportDecl pass)
-&gt; (Maybe FastString, GenLocated SrcSpan ModuleName)
</span><a href="#local-6989586621681211123"><span class="hs-identifier hs-var">convImport</span></a></span><span> </span><span class="annot"><span class="annottext">[LImportDecl GhcPs]
</span><a href="#local-6989586621681211140"><span class="hs-identifier hs-var">src_idecls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-807"></span><span>            </span><span class="annot"><span class="annottext">ms_textual_imps :: [(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="GHC.Driver.Types.html#ms_textual_imps"><span class="hs-identifier hs-var">ms_textual_imps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211118"><span class="hs-identifier hs-var">normal_imports</span></a></span><span>
</span><span id="line-808"></span><span>                           </span><span class="hs-comment">-- We have to do something special here:</span><span>
</span><span id="line-809"></span><span>                           </span><span class="hs-comment">-- due to merging, requirements may end up with</span><span>
</span><span id="line-810"></span><span>                           </span><span class="hs-comment">-- extra imports</span><span>
</span><span id="line-811"></span><span>                           </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211119"><span class="hs-identifier hs-var">extra_sig_imports</span></a></span><span>
</span><span id="line-812"></span><span>                           </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
-&gt; [(Maybe FastString, GenLocated SrcSpan ModuleName)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Maybe FastString, GenLocated SrcSpan ModuleName)]
</span><a href="#local-6989586621681211117"><span class="hs-identifier hs-var">required_by_imports</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-813"></span><span>            </span><span class="hs-comment">-- This is our hack to get the parse tree to the right spot</span><span>
</span><span id="line-814"></span><span>            </span><span class="annot"><span class="annottext">ms_parsed_mod :: Maybe HsParsedModule
</span><a href="GHC.Driver.Types.html#ms_parsed_mod"><span class="hs-identifier hs-var">ms_parsed_mod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsParsedModule -&gt; Maybe HsParsedModule
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsParsedModule :: Located HsModule -&gt; [FilePath] -&gt; ApiAnns -&gt; HsParsedModule
</span><a href="GHC.Driver.Types.html#HsParsedModule"><span class="hs-identifier hs-type">HsParsedModule</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-815"></span><span>                    </span><span class="annot"><span class="annottext">hpm_module :: Located HsModule
</span><a href="GHC.Driver.Types.html#hpm_module"><span class="hs-identifier hs-var">hpm_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located HsModule
</span><a href="#local-6989586621681211156"><span class="hs-identifier hs-var">hsmod</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-816"></span><span>                    </span><span class="annot"><span class="annottext">hpm_src_files :: [FilePath]
</span><a href="GHC.Driver.Types.html#hpm_src_files"><span class="hs-identifier hs-var">hpm_src_files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- TODO if we preprocessed it</span><span>
</span><span id="line-817"></span><span>                    </span><span class="annot"><span class="annottext">hpm_annotations :: ApiAnns
</span><a href="GHC.Driver.Types.html#hpm_annotations"><span class="hs-identifier hs-var">hpm_annotations</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map ApiAnnKey [RealSrcSpan]
-&gt; Maybe RealSrcSpan
-&gt; Map RealSrcSpan [RealLocated AnnotationComment]
-&gt; [RealLocated AnnotationComment]
-&gt; ApiAnns
</span><a href="GHC.Parser.Annotation.html#ApiAnns"><span class="hs-identifier hs-var">ApiAnns</span></a></span><span> </span><span class="annot"><span class="annottext">Map ApiAnnKey [RealSrcSpan]
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe RealSrcSpan
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">Map RealSrcSpan [RealLocated AnnotationComment]
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- BOGUS</span><span>
</span><span id="line-818"></span><span>                </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-819"></span><span>            </span><span class="annot"><span class="annottext">ms_hs_date :: UTCTime
</span><a href="GHC.Driver.Types.html#ms_hs_date"><span class="hs-identifier hs-var">ms_hs_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621681211145"><span class="hs-identifier hs-var">time</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-820"></span><span>            </span><span class="annot"><span class="annottext">ms_obj_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_obj_date"><span class="hs-identifier hs-var">ms_obj_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- TODO do this, but problem: hi_timestamp is BOGUS</span><span>
</span><span id="line-821"></span><span>            </span><span class="annot"><span class="annottext">ms_iface_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_iface_date"><span class="hs-identifier hs-var">ms_iface_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211144"><span class="hs-identifier hs-var">hi_timestamp</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-822"></span><span>            </span><span class="annot"><span class="annottext">ms_hie_date :: Maybe UTCTime
</span><a href="GHC.Driver.Types.html#ms_hie_date"><span class="hs-identifier hs-var">ms_hie_date</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621681211143"><span class="hs-identifier hs-var">hie_timestamp</span></a></span><span>
</span><span id="line-823"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span class="hs-comment">-- | Create a new, externally provided hashed unit id from</span><span>
</span><span id="line-826"></span><span class="hs-comment">-- a hash.</span><span>
</span><span id="line-827"></span><span class="annot"><a href="GHC.Driver.Backpack.html#newUnitId"><span class="hs-identifier hs-type">newUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#IndefUnitId"><span class="hs-identifier hs-type">IndefUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span>
</span><span id="line-828"></span><span id="newUnitId"><span class="annot"><span class="annottext">newUnitId :: IndefUnitId -&gt; Maybe FastString -&gt; UnitId
</span><a href="GHC.Driver.Backpack.html#newUnitId"><span class="hs-identifier hs-var hs-var">newUnitId</span></a></span></span><span> </span><span id="local-6989586621681211112"><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211112"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621681211111"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681211111"><span class="hs-identifier hs-var">mhash</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621681211111"><span class="hs-identifier hs-var">mhash</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-829"></span><span>   </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IndefUnitId -&gt; UnitId
forall unit. Indefinite unit -&gt; unit
</span><a href="GHC.Unit.Types.html#indefUnit"><span class="hs-identifier hs-var hs-var">indefUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211112"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-830"></span><span>   </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681211110"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211110"><span class="hs-identifier hs-var">hash</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; UnitId
</span><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-var">UnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitIdFS"><span class="hs-identifier hs-var hs-var">unitIdFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefUnitId -&gt; UnitId
forall unit. Indefinite unit -&gt; unit
</span><a href="GHC.Unit.Types.html#indefUnit"><span class="hs-identifier hs-var hs-var">indefUnit</span></a></span><span> </span><span class="annot"><span class="annottext">IndefUnitId
</span><a href="#local-6989586621681211112"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; FastString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-operator hs-var">`appendFS`</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;+&quot;</span></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; FastString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-operator hs-var">`appendFS`</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681211110"><span class="hs-identifier hs-var">hash</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-831"></span></pre></body></html>